From 4d16fc26b4ca40585a543243acc93abd73982de5 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Thu, 1 Nov 2018 09:02:59 +0100 Subject: [PATCH 01/25] WIP - Generate models from swagger spec --- bin/generator.py | 134 +++++++++++++++++++++++++++++++++++++++++++++++ bin/model.jinja2 | 26 +++++++++ 2 files changed, 160 insertions(+) create mode 100644 bin/generator.py create mode 100644 bin/model.jinja2 diff --git a/bin/generator.py b/bin/generator.py new file mode 100644 index 0000000..2e9e2bc --- /dev/null +++ b/bin/generator.py @@ -0,0 +1,134 @@ +#!/usr/bin/env python +# -*- coding: utf-8 + +import os +from collections import namedtuple, defaultdict +from pprint import pprint + +import appdirs +import requests +from cachecontrol import CacheControl +from cachecontrol.caches import FileCache +from jinja2 import Environment, FileSystemLoader + +SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.12/api/openapi-spec/swagger.json" +HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) + +GVK = namedtuple("GVK", ("group", "version", "kind")) +Field = namedtuple("Field", ("name", "description", "type", "ref")) +Definition = namedtuple("Definition", ("package", "name", "description", "fields")) +Operation = namedtuple("Operation", ("path", "action", "description")) +Model = namedtuple("Model", ("gvk", "definition", "operations")) +Import = namedtuple("Import", ("package", "name")) + + +def _parse_definitions(definitions): + result = defaultdict(list) + for id, item in definitions.items(): + package, kind = id[len("io.k8s."):].rsplit(".", 1) + package = package.replace("-", "_") + gvks = item.get("x-kubernetes-group-version-kind") + if not gvks: + continue + keys = (GVK(**x) for x in gvks) + fields = [] + for name, property in item["properties"].items(): + fields.append(Field(name, property.get("description", ""), property.get("type"), property.get("$ref"))) + definition = Definition(package, kind, item.get("description", ""), fields) + for key in keys: + result[key].append(definition) + total = sum(len(x) for x in result.values()) + print("Extracted {} gvks, with {} definitions in total".format(len(result), total)) + return result + + +def _parse_paths(paths): + result = defaultdict(list) + for id, item in paths.items(): + methods = (p for p in item.keys() if p not in ("parameters", "$ref")) + for method in methods: + operation = item[method] + gvks = operation.get("x-kubernetes-group-version-kind") + if not gvks: + continue + key = GVK(**gvks) + action = operation.get("x-kubernetes-action") + if not action: + continue + o = Operation(id, action, operation.get("description", "")) + result[key].append(o) + total = sum(len(x) for x in result.values()) + print("Extracted {} gvks, with {} operations in total".format(len(result), total)) + return result + + +def _make_models(definitions, operations): + result = defaultdict(list) + for gvk in definitions.keys(): + print("Generating model for {}, based on this definition:".format(gvk)) + pprint(definitions[gvk]) + definition = definitions[gvk][-1] + result[definition.package].append(Model(gvk, definition, operations[gvk])) + print("Collected {} models in total".format(len(result))) + return result + + +def _generate_package(package, models, imports, output_dir): + env = Environment( + loader=FileSystemLoader(os.path.dirname(__file__)), + trim_blocks=True, + lstrip_blocks=True, + ) + file_path = os.path.join(output_dir, package.replace(".", os.sep)) + package_dir = os.path.dirname(file_path) + if not os.path.isdir(package_dir): + os.makedirs(package_dir) + for root, dirs, files in os.walk(output_dir): + if "__init__.py" in files: + continue + with open(os.path.join(root, "__init__.py"), "w") as fobj: + fobj.write("# Generated file") + template = env.get_template("model.jinja2") + with open(file_path, "w") as fobj: + fobj.write(template.render(models=models, imports=imports)) + + +def _resolve_ref(ref): + return ref[len("#/definitions/io.k8s."):] + + +def _resolve_types(package, models): + imports = set() + for model in models: + new_fields = [] + for field in model.definition.fields: + if field.ref: + field_type = _resolve_ref(field.ref) + else: + field_type = field.type + if "." in field_type: + if not field_type.startswith(package): + field_package, field_type = field_type.rsplit(".", 1) + imports.add(Import(field_package, field_type)) + new_fields.append(field._replace(type=field_type)) + model.definition.fields[:] = new_fields + return imports + + +def main(): + resp = HTTP_CLIENT_SESSION.get(SPEC_URL) + spec = resp.json() + for key in ("paths", "definitions", "parameters", "responses", "securityDefinitions", "security", "tags"): + print("Specification contains {} {}".format(len(spec.get(key, [])), key)) + pprint(spec["info"]) + definitions = _parse_definitions(spec["definitions"]) + operations = _parse_paths(spec["paths"]) + models = _make_models(definitions, operations) + for package, models in models.items(): + imports = _resolve_types(package, models) + _generate_package(package, models, imports, + os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models")) + + +if __name__ == "__main__": + main() diff --git a/bin/model.jinja2 b/bin/model.jinja2 new file mode 100644 index 0000000..f3b269b --- /dev/null +++ b/bin/model.jinja2 @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field +{% for import in imports|sort %} +from k8s.models.{{ import.package }} import {{ import.name }} +{% endfor %} + +{% for model in models|sort %} + +class {{ model.definition.name }}(Model): + """ + {{ model.definition.description|replace('"', '\'')|wordwrap|indent }} + """ + apiVersion = Field(six.text_type, "{{ [model.gvk.group, model.gvk.version]|select|join("/") }}") + kind = Field(six.text_type, "{{ model.gvk.kind }}") + +{% for field in model.definition.fields|rejectattr("name", "in", ("apiVersion", "kind"))|sort %} + {{ field.name }} = Field({{ field.type }}) +{% endfor %} + +{% endfor %} From 3d08714f0a1a7bcd4bf1f4fbe19c3774a1897c57 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 20 Nov 2018 09:55:26 +0100 Subject: [PATCH 02/25] Correctly generate types and imports --- bin/generator.py | 65 ++++++++++++++++++++++++++++++------------------ bin/model.jinja2 | 7 ++++-- 2 files changed, 46 insertions(+), 26 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 2e9e2bc..e325ff2 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -13,32 +13,46 @@ SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.12/api/openapi-spec/swagger.json" HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) +TYPE_MAPPING = { + "integer": "int", + "float": "float", + "number": "float", + "long": "int", + "double": "float", + "array": "list", + "map": "dict", + "boolean": "bool", + "string": "str", + "date": "date", + "DateTime": "datetime", + "object": "dict", + "file": "file", + "binary": "bytes", + "ByteArray": "bytes", + "UUID": "str", +} GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref")) -Definition = namedtuple("Definition", ("package", "name", "description", "fields")) +Definition = namedtuple("Definition", ("package", "name", "description", "fields", "gvks")) Operation = namedtuple("Operation", ("path", "action", "description")) -Model = namedtuple("Model", ("gvk", "definition", "operations")) +Model = namedtuple("Model", ("definition", "operations")) Import = namedtuple("Import", ("package", "name")) def _parse_definitions(definitions): - result = defaultdict(list) + result = {} for id, item in definitions.items(): - package, kind = id[len("io.k8s."):].rsplit(".", 1) + package, name = id[len("io.k8s."):].rsplit(".", 1) package = package.replace("-", "_") - gvks = item.get("x-kubernetes-group-version-kind") - if not gvks: - continue - keys = (GVK(**x) for x in gvks) + gvks = [GVK(**x) for x in item.get("x-kubernetes-group-version-kind", [])] fields = [] - for name, property in item["properties"].items(): - fields.append(Field(name, property.get("description", ""), property.get("type"), property.get("$ref"))) - definition = Definition(package, kind, item.get("description", ""), fields) - for key in keys: - result[key].append(definition) - total = sum(len(x) for x in result.values()) - print("Extracted {} gvks, with {} definitions in total".format(len(result), total)) + for field_name, property in item.get("properties", {}).items(): + fields.append(Field(field_name, property.get("description", ""), property.get("type"), property.get("$ref"))) + definition = Definition(package, name, item.get("description", ""), fields, gvks) + key = (package, name) + result[key] = definition + print("Extracted {} definitions in total".format(len(result))) return result @@ -64,11 +78,12 @@ def _parse_paths(paths): def _make_models(definitions, operations): result = defaultdict(list) - for gvk in definitions.keys(): - print("Generating model for {}, based on this definition:".format(gvk)) - pprint(definitions[gvk]) - definition = definitions[gvk][-1] - result[definition.package].append(Model(gvk, definition, operations[gvk])) + for key in definitions.keys(): + package, name = key + print("Generating model for {}.{}, based on this definition:".format(package, name)) + definition = definitions[key] + pprint(definition) + result[definition.package].append(Model(definition, None)) print("Collected {} models in total".format(len(result))) return result @@ -79,7 +94,7 @@ def _generate_package(package, models, imports, output_dir): trim_blocks=True, lstrip_blocks=True, ) - file_path = os.path.join(output_dir, package.replace(".", os.sep)) + file_path = os.path.join(output_dir, package.replace(".", os.sep)) + ".py" package_dir = os.path.dirname(file_path) if not os.path.isdir(package_dir): os.makedirs(package_dir) @@ -105,11 +120,13 @@ def _resolve_types(package, models): if field.ref: field_type = _resolve_ref(field.ref) else: - field_type = field.type + field_type = TYPE_MAPPING.get(field.type, field.type) if "." in field_type: if not field_type.startswith(package): field_package, field_type = field_type.rsplit(".", 1) imports.add(Import(field_package, field_type)) + else: + field_type = field_type[len(package)+1:] new_fields.append(field._replace(type=field_type)) model.definition.fields[:] = new_fields return imports @@ -122,8 +139,8 @@ def main(): print("Specification contains {} {}".format(len(spec.get(key, [])), key)) pprint(spec["info"]) definitions = _parse_definitions(spec["definitions"]) - operations = _parse_paths(spec["paths"]) - models = _make_models(definitions, operations) + #operations = _parse_paths(spec["paths"]) + models = _make_models(definitions, None) for package, models in models.items(): imports = _resolve_types(package, models) _generate_package(package, models, imports, diff --git a/bin/model.jinja2 b/bin/model.jinja2 index f3b269b..edbff7d 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -16,8 +16,11 @@ class {{ model.definition.name }}(Model): """ {{ model.definition.description|replace('"', '\'')|wordwrap|indent }} """ - apiVersion = Field(six.text_type, "{{ [model.gvk.group, model.gvk.version]|select|join("/") }}") - kind = Field(six.text_type, "{{ model.gvk.kind }}") +{% if model.definition.gvks %} +{% set gvk = model.definition.gvks[-1] %} + apiVersion = Field(six.text_type, "{{ [gvk.group, gvk.version]|select|join("/") }}") + kind = Field(six.text_type, "{{ gvk.kind }}") +{% endif %} {% for field in model.definition.fields|rejectattr("name", "in", ("apiVersion", "kind"))|sort %} {{ field.name }} = Field({{ field.type }}) From 76c3d1ec509db15caa6713e3b8b0d02d65272407 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 20 Nov 2018 22:39:53 +0100 Subject: [PATCH 03/25] Ensure all models used in fields are rendered before models that needs them --- bin/generator.py | 303 +++++++++++++++++++++++++++++++---------------- bin/model.jinja2 | 8 +- 2 files changed, 206 insertions(+), 105 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index e325ff2..8e37305 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 import os -from collections import namedtuple, defaultdict +from collections import namedtuple from pprint import pprint import appdirs @@ -22,7 +22,7 @@ "array": "list", "map": "dict", "boolean": "bool", - "string": "str", + "string": "six.text_type", "date": "date", "DateTime": "datetime", "object": "dict", @@ -34,102 +34,205 @@ GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref")) -Definition = namedtuple("Definition", ("package", "name", "description", "fields", "gvks")) -Operation = namedtuple("Operation", ("path", "action", "description")) -Model = namedtuple("Model", ("definition", "operations")) -Import = namedtuple("Import", ("package", "name")) - - -def _parse_definitions(definitions): - result = {} - for id, item in definitions.items(): - package, name = id[len("io.k8s."):].rsplit(".", 1) - package = package.replace("-", "_") - gvks = [GVK(**x) for x in item.get("x-kubernetes-group-version-kind", [])] - fields = [] - for field_name, property in item.get("properties", {}).items(): - fields.append(Field(field_name, property.get("description", ""), property.get("type"), property.get("$ref"))) - definition = Definition(package, name, item.get("description", ""), fields, gvks) - key = (package, name) - result[key] = definition - print("Extracted {} definitions in total".format(len(result))) - return result - - -def _parse_paths(paths): - result = defaultdict(list) - for id, item in paths.items(): - methods = (p for p in item.keys() if p not in ("parameters", "$ref")) - for method in methods: - operation = item[method] - gvks = operation.get("x-kubernetes-group-version-kind") - if not gvks: - continue - key = GVK(**gvks) - action = operation.get("x-kubernetes-action") - if not action: - continue - o = Operation(id, action, operation.get("description", "")) - result[key].append(o) - total = sum(len(x) for x in result.values()) - print("Extracted {} gvks, with {} operations in total".format(len(result), total)) - return result - - -def _make_models(definitions, operations): - result = defaultdict(list) - for key in definitions.keys(): - package, name = key - print("Generating model for {}.{}, based on this definition:".format(package, name)) - definition = definitions[key] - pprint(definition) - result[definition.package].append(Model(definition, None)) - print("Collected {} models in total".format(len(result))) - return result - - -def _generate_package(package, models, imports, output_dir): - env = Environment( - loader=FileSystemLoader(os.path.dirname(__file__)), - trim_blocks=True, - lstrip_blocks=True, - ) - file_path = os.path.join(output_dir, package.replace(".", os.sep)) + ".py" - package_dir = os.path.dirname(file_path) - if not os.path.isdir(package_dir): - os.makedirs(package_dir) - for root, dirs, files in os.walk(output_dir): - if "__init__.py" in files: - continue - with open(os.path.join(root, "__init__.py"), "w") as fobj: - fobj.write("# Generated file") - template = env.get_template("model.jinja2") - with open(file_path, "w") as fobj: - fobj.write(template.render(models=models, imports=imports)) - - -def _resolve_ref(ref): - return ref[len("#/definitions/io.k8s."):] - - -def _resolve_types(package, models): - imports = set() - for model in models: +Definition = namedtuple("Definition", ("name", "description", "fields", "gvks")) + + +# Operation = namedtuple("Operation", ("path", "action", "description")) +# Model = namedtuple("Model", ("definition", "operations")) + + +class Primitive(object): + def __init__(self, type): + self.name = TYPE_MAPPING.get(type, type) + + +class Child(object): + @property + def parent_ref(self): + return self.ref.rsplit(".", 1)[0] + + +class Module(namedtuple("Module", ("ref", "name", "imports", "models")), Child): + pass + + +class Model(namedtuple("Model", ("ref", "definition",)), Child): + @property + def name(self): + return self.definition.name + + +class Package(namedtuple("Package", ("ref", "modules"))): + @property + def path(self): + return self.ref.replace(".", os.sep) + + +class Import(namedtuple("Import", ("module", "models"))): + @property + def names(self): + return sorted(m.definition.name for m in self.models) + + +class Parser(object): + def __init__(self, spec): + self._spec = spec.get("definitions", {}) + self._packages = {} + self._modules = {} + self._models = {} + + def parse(self): + self._parse_models() + self._resolve_references() + self._sort() + return self._packages.values() + + def _parse_models(self): + for id, item in self._spec.items(): + package_ref, module_name, def_name = _split_ref(id[len("io.k8s."):]) + package = self._get_package(package_ref) + module = self._get_module(package, module_name) + gvks = [GVK(**x) for x in item.get("x-kubernetes-group-version-kind", [])] + fields = [] + for field_name, property in item.get("properties", {}).items(): + fields.append( + Field(field_name, property.get("description", ""), property.get("type"), property.get("$ref"))) + definition = Definition(def_name, item.get("description", ""), fields, gvks) + model = Model(_make_ref(package.ref, module.name, def_name), definition) + module.models.append(model) + self._models[model.ref] = model + print("Completed parse. Parsed {} packages, {} modules and {} models.".format(len(self._packages), + len(self._modules), + len(self._models))) + + def _get_package(self, package_ref): + if package_ref not in self._packages: + package = Package(package_ref, []) + self._packages[package_ref] = package + return self._packages[package_ref] + + def _get_module(self, package, module_name): + ref = _make_ref(package.ref, module_name) + if ref not in self._modules: + module = Module(ref, module_name, [], []) + package.modules.append(module) + self._modules[ref] = module + return self._modules[ref] + + def _get_model(self, package, module, def_name): + ref = _make_ref(package.ref, module.name, def_name) + return self._models[ref] + + def _resolve_references(self): + for module in self._modules.values(): + imports = {} + for model in module.models: + self._resolve_fields(model.definition) + for field in model.definition.fields: + ft = field.type + if isinstance(ft, Model): + if ft.parent_ref != model.parent_ref: + if ft.parent_ref not in imports: + package_ref, module_name, def_name = _split_ref(ft.ref) + package = self._get_package(package_ref) + ft_module = self._get_module(package, module_name) + imports[ft.parent_ref] = Import(ft_module, []) + imp = imports[ft.parent_ref] + if ft not in imp.models: + imp.models.append(ft) + module.imports[:] = imports.values() + + def _resolve_fields(self, definition): new_fields = [] - for field in model.definition.fields: + for field in definition.fields: if field.ref: - field_type = _resolve_ref(field.ref) + field_type = self._resolve_ref(field.ref) else: - field_type = TYPE_MAPPING.get(field.type, field.type) - if "." in field_type: - if not field_type.startswith(package): - field_package, field_type = field_type.rsplit(".", 1) - imports.add(Import(field_package, field_type)) - else: - field_type = field_type[len(package)+1:] + field_type = Primitive(field.type) new_fields.append(field._replace(type=field_type)) - model.definition.fields[:] = new_fields - return imports + definition.fields[:] = new_fields + + def _resolve_ref(self, ref): + package_ref, module_name, def_name = _split_ref(ref[len("#/definitions/io.k8s."):]) + package = self._get_package(package_ref) + module = self._get_module(package, module_name) + model = self._get_model(package, module, def_name) + return model + + def _sort(self): + for package in self._packages.values(): + for module in package.modules: + module.imports.sort(key=lambda i: i.module.ref) + module.models[:] = self._sort_models(module.models) + + def _sort_models(self, models): + """We need to make sure that any model that references an other model comes later in the list""" + Node = namedtuple("Node", ("model", "dependants", "dependencies")) + nodes = {} + for model in models: + node = nodes.setdefault(model.ref, Node(model, [], [])) + for field in model.definition.fields: + if isinstance(field.type, Model) and field.type.parent_ref == model.parent_ref: + dep = nodes.setdefault(field.type.ref, Node(field.type, [], [])) + node.dependencies.append(dep) + for node in nodes.values(): + for dep in node.dependencies: + dep.dependants.append(node) + top_nodes = [n for n in nodes.values() if len(n.dependencies) == 0] + models = [] + while top_nodes: + top_node = top_nodes.pop() + models.append(top_node.model) + for dep in top_node.dependants: + dep.dependencies.remove(top_node) + if len(dep.dependencies) == 0: + top_nodes.append(dep) + return models + + +class Generator(object): + def __init__(self, packages, output_dir): + self._packages = packages + self._output_dir = output_dir + self._env = Environment( + loader=FileSystemLoader(os.path.dirname(__file__)), + trim_blocks=True, + lstrip_blocks=True, + ) + + def generate(self): + print("Generating models in {}".format(self._output_dir)) + for package in self._packages: + self._generate_package(package) + for root, dirs, files in os.walk(self._output_dir): + if "__init__.py" in files: + continue + with open(os.path.join(root, "__init__.py"), "w") as fobj: + fobj.write("# Generated file") + + def _generate_package(self, package): + package_dir = os.path.join(self._output_dir, package.path) + if not os.path.isdir(package_dir): + os.makedirs(package_dir) + print("Created package {}.".format(package.ref)) + for module in package.modules: + self._generate_module(module, package_dir) + + def _generate_module(self, module, package_dir): + template = self._env.get_template("model.jinja2") + module_path = os.path.join(package_dir, module.name) + ".py" + with open(module_path, "w") as fobj: + fobj.write(template.render(module=module)) + print("Generated module {}.".format(module.ref)) + + +def _split_ref(s): + s = s.replace("-", "_") + return s.rsplit(".", 2) + + +def _make_ref(*args): + return ".".join(args) def main(): @@ -138,13 +241,11 @@ def main(): for key in ("paths", "definitions", "parameters", "responses", "securityDefinitions", "security", "tags"): print("Specification contains {} {}".format(len(spec.get(key, [])), key)) pprint(spec["info"]) - definitions = _parse_definitions(spec["definitions"]) - #operations = _parse_paths(spec["paths"]) - models = _make_models(definitions, None) - for package, models in models.items(): - imports = _resolve_types(package, models) - _generate_package(package, models, imports, - os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models")) + output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models") + parser = Parser(spec) + packages = parser.parse() + generator = Generator(packages, output_dir) + generator.generate() if __name__ == "__main__": diff --git a/bin/model.jinja2 b/bin/model.jinja2 index edbff7d..a125880 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -6,11 +6,11 @@ import six from k8s.base import Model from k8s.fields import Field -{% for import in imports|sort %} -from k8s.models.{{ import.package }} import {{ import.name }} +{% for import in module.imports %} +from k8s.models.{{ import.module.ref }} import {{ import.names|join(", ") }} {% endfor %} -{% for model in models|sort %} +{% for model in module.models %} class {{ model.definition.name }}(Model): """ @@ -23,7 +23,7 @@ class {{ model.definition.name }}(Model): {% endif %} {% for field in model.definition.fields|rejectattr("name", "in", ("apiVersion", "kind"))|sort %} - {{ field.name }} = Field({{ field.type }}) + {{ field.name }} = Field({{ field.type.name }}) {% endfor %} {% endfor %} From 6a53eb693d4fc09e2a66fc1add7d3ed158cf2891 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 21 Nov 2018 14:35:27 +0100 Subject: [PATCH 04/25] Generate for 1.6 instead of 1.12, and handle field_names that are keywords --- bin/generator.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 8e37305..55e7668 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 - +import keyword import os from collections import namedtuple from pprint import pprint @@ -11,7 +11,7 @@ from cachecontrol.caches import FileCache from jinja2 import Environment, FileSystemLoader -SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.12/api/openapi-spec/swagger.json" +SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.6/api/openapi-spec/swagger.json" HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -92,9 +92,14 @@ def _parse_models(self): package_ref, module_name, def_name = _split_ref(id[len("io.k8s."):]) package = self._get_package(package_ref) module = self._get_module(package, module_name) - gvks = [GVK(**x) for x in item.get("x-kubernetes-group-version-kind", [])] + gvks = [] + for x in item.get("x-kubernetes-group-version-kind", []): + x = {k.lower(): v for k, v in x.items()} + gvks.append(GVK(**x)) fields = [] for field_name, property in item.get("properties", {}).items(): + if keyword.iskeyword(field_name): + field_name = "_{}".format(field_name) fields.append( Field(field_name, property.get("description", ""), property.get("type"), property.get("$ref"))) definition = Definition(def_name, item.get("description", ""), fields, gvks) From 8b2a0f19dfd3e47c3a95a3bfa9b9ec1719ef473d Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 27 Nov 2018 13:00:36 +0100 Subject: [PATCH 05/25] Handle Quantity, IntOrString and Time fields, and some arrays --- bin/generator.py | 57 ++++++++++++++++++++++++++++++++++++------------ bin/model.jinja2 | 7 ++++-- 2 files changed, 48 insertions(+), 16 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 55e7668..e0abbef 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -33,7 +33,7 @@ } GVK = namedtuple("GVK", ("group", "version", "kind")) -Field = namedtuple("Field", ("name", "description", "type", "ref")) +Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) Definition = namedtuple("Definition", ("name", "description", "fields", "gvks")) @@ -75,6 +75,11 @@ def names(self): class Parser(object): + _SPECIAL_TYPES = { + "apimachinery.pkg.api.resource.Quantity": Primitive("string"), + "apimachinery.pkg.apis.meta.v1.Time": Primitive("datetime.datetime"), + } + def __init__(self, spec): self._spec = spec.get("definitions", {}) self._packages = {} @@ -98,10 +103,7 @@ def _parse_models(self): gvks.append(GVK(**x)) fields = [] for field_name, property in item.get("properties", {}).items(): - if keyword.iskeyword(field_name): - field_name = "_{}".format(field_name) - fields.append( - Field(field_name, property.get("description", ""), property.get("type"), property.get("$ref"))) + fields.append(self._parse_field(field_name, property)) definition = Definition(def_name, item.get("description", ""), fields, gvks) model = Model(_make_ref(package.ref, module.name, def_name), definition) module.models.append(model) @@ -110,6 +112,22 @@ def _parse_models(self): len(self._modules), len(self._models))) + def _parse_field(self, field_name, property): + # TODO: Handle the following special cases: + # * additionalProperties specifying an overriding type/$ref. + # * format with more detailed description of the object (bytes, date-time). + if keyword.iskeyword(field_name): + field_name = "_{}".format(field_name) + field_type = property.get("type") + field_ref = property.get("$ref") + field_cls = "Field" + if field_type == "array" and "items" in property: + field_type = property["items"].get("type") + field_ref = property["items"].get("$ref") + field_cls = "ListField" + field = Field(field_name, property.get("description", ""), field_type, field_ref, field_cls, None) + return field + def _get_package(self, package_ref): if package_ref not in self._packages: package = Package(package_ref, []) @@ -150,19 +168,30 @@ def _resolve_references(self): def _resolve_fields(self, definition): new_fields = [] for field in definition.fields: - if field.ref: - field_type = self._resolve_ref(field.ref) + if field.ref == "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString": + new_fields.append(field._replace(type=Primitive("string"), alt_type=Primitive("integer"))) else: - field_type = Primitive(field.type) - new_fields.append(field._replace(type=field_type)) + if field.ref: + field_type = self._resolve_ref(field.ref) + else: + field_type = self._resolve_field(field.type) + new_fields.append(field._replace(type=field_type)) definition.fields[:] = new_fields def _resolve_ref(self, ref): - package_ref, module_name, def_name = _split_ref(ref[len("#/definitions/io.k8s."):]) - package = self._get_package(package_ref) - module = self._get_module(package, module_name) - model = self._get_model(package, module, def_name) - return model + if ref: + ref_name = ref[len("#/definitions/io.k8s."):] + if ref_name in self._SPECIAL_TYPES: + return self._SPECIAL_TYPES[ref_name] + package_ref, module_name, def_name = _split_ref(ref_name) + package = self._get_package(package_ref) + module = self._get_module(package, module_name) + model = self._get_model(package, module, def_name) + return model + + def _resolve_field(self, type): + if type: + return Primitive(type) def _sort(self): for package in self._packages.values(): diff --git a/bin/model.jinja2 b/bin/model.jinja2 index a125880..41ea5bb 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -3,9 +3,10 @@ from __future__ import absolute_import import six +import datetime from k8s.base import Model -from k8s.fields import Field +from k8s.fields import Field, ListField {% for import in module.imports %} from k8s.models.{{ import.module.ref }} import {{ import.names|join(", ") }} {% endfor %} @@ -23,7 +24,9 @@ class {{ model.definition.name }}(Model): {% endif %} {% for field in model.definition.fields|rejectattr("name", "in", ("apiVersion", "kind"))|sort %} - {{ field.name }} = Field({{ field.type.name }}) + {{ field.name }} = {{ field.cls }}({{ field.type.name }}{% if field.alt_type %}, alt_type={{ field.alt_type.name }}{% endif %}) +{% else %} + # Model has no fields {% endfor %} {% endfor %} From 0ba642a4348766472eb9fd56b408b404678f4285 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 27 Nov 2018 14:39:23 +0100 Subject: [PATCH 06/25] Completed parsing and generation of plain Models --- bin/generator.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index e0abbef..cb99f74 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -113,9 +113,6 @@ def _parse_models(self): len(self._models))) def _parse_field(self, field_name, property): - # TODO: Handle the following special cases: - # * additionalProperties specifying an overriding type/$ref. - # * format with more detailed description of the object (bytes, date-time). if keyword.iskeyword(field_name): field_name = "_{}".format(field_name) field_type = property.get("type") From d079d2d8a85f887b1e1bd3fc8932c812025eb915 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 27 Nov 2018 14:47:58 +0100 Subject: [PATCH 07/25] Skip empty Models --- bin/generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/generator.py b/bin/generator.py index cb99f74..507e982 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -78,6 +78,7 @@ class Parser(object): _SPECIAL_TYPES = { "apimachinery.pkg.api.resource.Quantity": Primitive("string"), "apimachinery.pkg.apis.meta.v1.Time": Primitive("datetime.datetime"), + "apimachinery.pkg.apis.meta.v1.Patch": Primitive("string"), } def __init__(self, spec): @@ -104,6 +105,9 @@ def _parse_models(self): fields = [] for field_name, property in item.get("properties", {}).items(): fields.append(self._parse_field(field_name, property)) + if not fields: + print("Model {}.{}.{} has no fields, skipping".format(package_ref, module_name, def_name)) + continue definition = Definition(def_name, item.get("description", ""), fields, gvks) model = Model(_make_ref(package.ref, module.name, def_name), definition) module.models.append(model) From 711e5a04830ba4edce2486c1ea251151077c4b27 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 7 Jan 2019 13:00:33 +0100 Subject: [PATCH 08/25] Attach operations to models --- bin/generator.py | 133 ++++++++++++++++++++++++++++++++++++++--------- bin/model.jinja2 | 7 +++ 2 files changed, 115 insertions(+), 25 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 507e982..ed01a86 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -2,7 +2,8 @@ # -*- coding: utf-8 import keyword import os -from collections import namedtuple +import posixpath +from collections import namedtuple, defaultdict, Counter from pprint import pprint import appdirs @@ -11,7 +12,7 @@ from cachecontrol.caches import FileCache from jinja2 import Environment, FileSystemLoader -SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.6/api/openapi-spec/swagger.json" +SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.7/api/openapi-spec/swagger.json" HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -35,10 +36,7 @@ GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) Definition = namedtuple("Definition", ("name", "description", "fields", "gvks")) - - -# Operation = namedtuple("Operation", ("path", "action", "description")) -# Model = namedtuple("Model", ("definition", "operations")) +Operation = namedtuple("Operation", ("path", "action")) class Primitive(object): @@ -56,7 +54,12 @@ class Module(namedtuple("Module", ("ref", "name", "imports", "models")), Child): pass -class Model(namedtuple("Model", ("ref", "definition",)), Child): +class Model(Child): + def __init__(self, ref, definition, operations=[]): + self.ref = ref + self.definition = definition + self.operations = operations + @property def name(self): return self.definition.name @@ -74,7 +77,7 @@ def names(self): return sorted(m.definition.name for m in self.models) -class Parser(object): +class PackageParser(object): _SPECIAL_TYPES = { "apimachinery.pkg.api.resource.Quantity": Primitive("string"), "apimachinery.pkg.apis.meta.v1.Time": Primitive("datetime.datetime"), @@ -86,6 +89,7 @@ def __init__(self, spec): self._packages = {} self._modules = {} self._models = {} + self._gvk_lookup = {} def parse(self): self._parse_models() @@ -96,8 +100,8 @@ def parse(self): def _parse_models(self): for id, item in self._spec.items(): package_ref, module_name, def_name = _split_ref(id[len("io.k8s."):]) - package = self._get_package(package_ref) - module = self._get_module(package, module_name) + package = self.get_package(package_ref) + module = self.get_module(package, module_name) gvks = [] for x in item.get("x-kubernetes-group-version-kind", []): x = {k.lower(): v for k, v in x.items()} @@ -112,9 +116,12 @@ def _parse_models(self): model = Model(_make_ref(package.ref, module.name, def_name), definition) module.models.append(model) self._models[model.ref] = model - print("Completed parse. Parsed {} packages, {} modules and {} models.".format(len(self._packages), - len(self._modules), - len(self._models))) + for gvk in gvks: + self._gvk_lookup[gvk] = model + print("Completed parse. Parsed {} packages, {} modules, {} models and {} GVKs.".format(len(self._packages), + len(self._modules), + len(self._models), + len(self._gvk_lookup))) def _parse_field(self, field_name, property): if keyword.iskeyword(field_name): @@ -129,13 +136,13 @@ def _parse_field(self, field_name, property): field = Field(field_name, property.get("description", ""), field_type, field_ref, field_cls, None) return field - def _get_package(self, package_ref): + def get_package(self, package_ref): if package_ref not in self._packages: package = Package(package_ref, []) self._packages[package_ref] = package return self._packages[package_ref] - def _get_module(self, package, module_name): + def get_module(self, package, module_name): ref = _make_ref(package.ref, module_name) if ref not in self._modules: module = Module(ref, module_name, [], []) @@ -143,7 +150,7 @@ def _get_module(self, package, module_name): self._modules[ref] = module return self._modules[ref] - def _get_model(self, package, module, def_name): + def get_model(self, package, module, def_name): ref = _make_ref(package.ref, module.name, def_name) return self._models[ref] @@ -158,8 +165,8 @@ def _resolve_references(self): if ft.parent_ref != model.parent_ref: if ft.parent_ref not in imports: package_ref, module_name, def_name = _split_ref(ft.ref) - package = self._get_package(package_ref) - ft_module = self._get_module(package, module_name) + package = self.get_package(package_ref) + ft_module = self.get_module(package, module_name) imports[ft.parent_ref] = Import(ft_module, []) imp = imports[ft.parent_ref] if ft not in imp.models: @@ -173,23 +180,26 @@ def _resolve_fields(self, definition): new_fields.append(field._replace(type=Primitive("string"), alt_type=Primitive("integer"))) else: if field.ref: - field_type = self._resolve_ref(field.ref) + field_type = self.resolve_ref(field.ref) else: field_type = self._resolve_field(field.type) new_fields.append(field._replace(type=field_type)) definition.fields[:] = new_fields - def _resolve_ref(self, ref): + def resolve_ref(self, ref): if ref: ref_name = ref[len("#/definitions/io.k8s."):] if ref_name in self._SPECIAL_TYPES: return self._SPECIAL_TYPES[ref_name] package_ref, module_name, def_name = _split_ref(ref_name) - package = self._get_package(package_ref) - module = self._get_module(package, module_name) - model = self._get_model(package, module, def_name) + package = self.get_package(package_ref) + module = self.get_module(package, module_name) + model = self.get_model(package, module, def_name) return model + def resolve_gvk(self, gvk): + return self._gvk_lookup.get(gvk) + def _resolve_field(self, type): if type: return Primitive(type) @@ -225,6 +235,74 @@ def _sort_models(self, models): return models +class ActionParser(object): + def __init__(self, spec, package_parser): + self._spec = spec.get("paths", {}) + self._package_parser = package_parser + + def parse(self): + counter = Counter() + operations = self._parse_operations() + for gvk, actions in operations.items(): + model = self._package_parser.resolve_gvk(gvk) + if not model: + print("GVK {} resolved to no known model".format(gvk)) + continue + model.operations = sorted(actions, key=lambda a: a.action) + counter[model] += len(actions) + print("Found {} actions distributed over {} models".format(sum(counter.values()), len(counter))) + + def _parse_operations(self): + operations = defaultdict(list) + for path, item in self._spec.items(): + if self._should_ignore_path(path): + continue + for method, operation in item.items(): + if self._should_ignore_method(method): + continue + action = operation.get("x-kubernetes-action", "__undefined__") + action = self._rename_action(action, path) + if self._should_ignore_action(action): + continue + gvk = self._resolve_gvk(operation) + if gvk: + operations[gvk].append(Operation(path, action)) + return operations + + @staticmethod + def _should_ignore_path(path): + last = posixpath.split(path)[-1] + return last in ("status", "scale", "rollback", "bindings", "log") + + @staticmethod + def _should_ignore_method(method): + return method in ("parameters", "patch") + + @staticmethod + def _rename_action(action, path): + if action.endswith("list"): + if "{namespace}" not in path: + action = "{}_all".format(action) + else: + action = "{}_ns".format(action) + renames = { + "post": "create", + "put": "update" + } + return renames.get(action, action) + + @staticmethod + def _should_ignore_action(action): + return action in ("__undefined__", "patch", "deletecollection", "proxy", "connect") + + @staticmethod + def _resolve_gvk(operation): + if not "x-kubernetes-group-version-kind" in operation: + return None + gvk = operation["x-kubernetes-group-version-kind"] + return GVK(gvk["group"], gvk["version"], gvk["kind"]) + + class Generator(object): def __init__(self, packages, output_dir): self._packages = packages @@ -277,8 +355,13 @@ def main(): print("Specification contains {} {}".format(len(spec.get(key, [])), key)) pprint(spec["info"]) output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models") - parser = Parser(spec) - packages = parser.parse() + package_parser = PackageParser(spec) + packages = package_parser.parse() + # TODO: + # - Skip modules with no models + # - Skip packages with no modules + action_parser = ActionParser(spec, package_parser) + action_parser.parse() generator = Generator(packages, output_dir) generator.generate() diff --git a/bin/model.jinja2 b/bin/model.jinja2 index 41ea5bb..0658f10 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -17,6 +17,13 @@ class {{ model.definition.name }}(Model): """ {{ model.definition.description|replace('"', '\'')|wordwrap|indent }} """ +{% if model.operations %} + class Meta: +{% for operation in model.operations %} + {{ operation.action }}_url = "{{ operation.path }}" +{% endfor %} + +{% endif %} {% if model.definition.gvks %} {% set gvk = model.definition.gvks[-1] %} apiVersion = Field(six.text_type, "{{ [gvk.group, gvk.version]|select|join("/") }}") From a787ddd341067e4aca7e91a00010adf8f14e723d Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 7 Jan 2019 13:07:44 +0100 Subject: [PATCH 09/25] Don't generate empty modules/packages --- bin/generator.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index ed01a86..611de55 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -3,6 +3,7 @@ import keyword import os import posixpath +import shutil from collections import namedtuple, defaultdict, Counter from pprint import pprint @@ -327,16 +328,25 @@ def _generate_package(self, package): package_dir = os.path.join(self._output_dir, package.path) if not os.path.isdir(package_dir): os.makedirs(package_dir) - print("Created package {}.".format(package.ref)) + generated = False for module in package.modules: - self._generate_module(module, package_dir) + generated = generated or self._generate_module(module, package_dir) + if not generated: + print("Package {} had no modules, skipping".format(package.ref)) + shutil.rmtree(package_dir) + else: + print("Created package {}.".format(package.ref)) def _generate_module(self, module, package_dir): + if not module.models: + print("Skipping module {}, as there are no models".format(module.ref)) + return False template = self._env.get_template("model.jinja2") module_path = os.path.join(package_dir, module.name) + ".py" with open(module_path, "w") as fobj: fobj.write(template.render(module=module)) print("Generated module {}.".format(module.ref)) + return True def _split_ref(s): @@ -357,9 +367,6 @@ def main(): output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models") package_parser = PackageParser(spec) packages = package_parser.parse() - # TODO: - # - Skip modules with no models - # - Skip packages with no modules action_parser = ActionParser(spec, package_parser) action_parser.parse() generator = Generator(packages, output_dir) From 078c37c813598914395bb734305e8883734e3f10 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 7 Jan 2019 15:38:11 +0100 Subject: [PATCH 10/25] Make package names less deep --- bin/generator.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 611de55..5bcce52 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -3,6 +3,7 @@ import keyword import os import posixpath +import re import shutil from collections import namedtuple, defaultdict, Counter from pprint import pprint @@ -33,6 +34,7 @@ "ByteArray": "bytes", "UUID": "str", } +REF_PATTERN = re.compile(r"io\.k8s\.(.+)\.pkg\.(.+)") GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) @@ -78,11 +80,18 @@ def names(self): return sorted(m.definition.name for m in self.models) +def shorten_ref(id): + m = REF_PATTERN.search(id) + if not m: + raise RuntimeError("Invalid id: {}".format(id)) + return ".".join(m.groups()) + + class PackageParser(object): _SPECIAL_TYPES = { - "apimachinery.pkg.api.resource.Quantity": Primitive("string"), - "apimachinery.pkg.apis.meta.v1.Time": Primitive("datetime.datetime"), - "apimachinery.pkg.apis.meta.v1.Patch": Primitive("string"), + "apimachinery.api.resource.Quantity": Primitive("string"), + "apimachinery.apis.meta.v1.Time": Primitive("datetime.datetime"), + "apimachinery.apis.meta.v1.Patch": Primitive("string"), } def __init__(self, spec): @@ -100,7 +109,8 @@ def parse(self): def _parse_models(self): for id, item in self._spec.items(): - package_ref, module_name, def_name = _split_ref(id[len("io.k8s."):]) + id = shorten_ref(id) + package_ref, module_name, def_name = _split_ref(id) package = self.get_package(package_ref) module = self.get_module(package, module_name) gvks = [] @@ -189,7 +199,7 @@ def _resolve_fields(self, definition): def resolve_ref(self, ref): if ref: - ref_name = ref[len("#/definitions/io.k8s."):] + ref_name = shorten_ref(ref) if ref_name in self._SPECIAL_TYPES: return self._SPECIAL_TYPES[ref_name] package_ref, module_name, def_name = _split_ref(ref_name) @@ -330,7 +340,7 @@ def _generate_package(self, package): os.makedirs(package_dir) generated = False for module in package.modules: - generated = generated or self._generate_module(module, package_dir) + generated = self._generate_module(module, package_dir) or generated if not generated: print("Package {} had no modules, skipping".format(package.ref)) shutil.rmtree(package_dir) From ef7e0486a10e3c2a6162f5c5e54eff8388725cce Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 8 Jan 2019 12:43:36 +0100 Subject: [PATCH 11/25] Generate models for all supported versions of Kubernetes --- bin/generator.py | 57 +++++++++++++++++++++++++++++++++--------------- bin/model.jinja2 | 2 +- 2 files changed, 40 insertions(+), 19 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 5bcce52..cca4f4e 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -6,7 +6,6 @@ import re import shutil from collections import namedtuple, defaultdict, Counter -from pprint import pprint import appdirs import requests @@ -14,7 +13,8 @@ from cachecontrol.caches import FileCache from jinja2 import Environment, FileSystemLoader -SPEC_URL = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.7/api/openapi-spec/swagger.json" +URL_TEMPLATE = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.{}/api/openapi-spec/swagger.json" +VERSION_RANGE = (6, 14) HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -34,7 +34,7 @@ "ByteArray": "bytes", "UUID": "str", } -REF_PATTERN = re.compile(r"io\.k8s\.(.+)\.pkg\.(.+)") +REF_PATTERN = re.compile(r"io\.k8s\.(.+)") GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) @@ -84,14 +84,27 @@ def shorten_ref(id): m = REF_PATTERN.search(id) if not m: raise RuntimeError("Invalid id: {}".format(id)) - return ".".join(m.groups()) + return m.group(1) class PackageParser(object): _SPECIAL_TYPES = { - "apimachinery.api.resource.Quantity": Primitive("string"), - "apimachinery.apis.meta.v1.Time": Primitive("datetime.datetime"), - "apimachinery.apis.meta.v1.Patch": Primitive("string"), + shorten_ref("io.k8s.apimachinery.pkg.api.resource.Quantity"): Primitive("string"), + shorten_ref("io.k8s.apimachinery.pkg.apis.meta.v1.Time"): Primitive("datetime.datetime"), + shorten_ref("io.k8s.apimachinery.pkg.apis.meta.v1.MicroTime"): Primitive("datetime.datetime"), + shorten_ref("io.k8s.apimachinery.pkg.apis.meta.v1.Patch"): Primitive("string"), + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus"): + Primitive("object"), # This might not be the right thing to do, but the spec is unclear + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON"): Primitive("object"), + } + _UNION_TYPES = { + shorten_ref("io.k8s.apimachinery.pkg.util.intstr.IntOrString"): (Primitive("string"), Primitive("integer")), + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrArray"): + (Primitive("dict"), Primitive("array")), + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrBool"): + (Primitive("dict"), Primitive("boolean")), + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaPropsOrStringArray"): + (Primitive("dict"), Primitive("array")), } def __init__(self, spec): @@ -187,8 +200,9 @@ def _resolve_references(self): def _resolve_fields(self, definition): new_fields = [] for field in definition.fields: - if field.ref == "#/definitions/io.k8s.apimachinery.pkg.util.intstr.IntOrString": - new_fields.append(field._replace(type=Primitive("string"), alt_type=Primitive("integer"))) + if field.ref and shorten_ref(field.ref) in self._UNION_TYPES: + new_type, new_alt_type = self._UNION_TYPES[shorten_ref(field.ref)] + new_fields.append(field._replace(type=new_type, alt_type=new_alt_type)) else: if field.ref: field_type = self.resolve_ref(field.ref) @@ -315,9 +329,10 @@ def _resolve_gvk(operation): class Generator(object): - def __init__(self, packages, output_dir): + def __init__(self, packages, output_dir, version): self._packages = packages self._output_dir = output_dir + self._version = version self._env = Environment( loader=FileSystemLoader(os.path.dirname(__file__)), trim_blocks=True, @@ -354,7 +369,7 @@ def _generate_module(self, module, package_dir): template = self._env.get_template("model.jinja2") module_path = os.path.join(package_dir, module.name) + ".py" with open(module_path, "w") as fobj: - fobj.write(template.render(module=module)) + fobj.write(template.render(module=module, version=self._version)) print("Generated module {}.".format(module.ref)) return True @@ -368,20 +383,26 @@ def _make_ref(*args): return ".".join(args) -def main(): - resp = HTTP_CLIENT_SESSION.get(SPEC_URL) +def _generate_version(version, url): + print("=== Generating models for version {} ===".format(version)) + print("Getting spec at {}".format(url)) + resp = HTTP_CLIENT_SESSION.get(url) spec = resp.json() - for key in ("paths", "definitions", "parameters", "responses", "securityDefinitions", "security", "tags"): - print("Specification contains {} {}".format(len(spec.get(key, [])), key)) - pprint(spec["info"]) - output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models") + output_dir = os.path.join(os.path.dirname(os.path.dirname(__file__)), "k8s", "models", version) package_parser = PackageParser(spec) packages = package_parser.parse() action_parser = ActionParser(spec, package_parser) action_parser.parse() - generator = Generator(packages, output_dir) + generator = Generator(packages, output_dir, version) generator.generate() +def main(): + for minor_version in range(*VERSION_RANGE): + version = "v1_{}".format(minor_version) + url = URL_TEMPLATE.format(minor_version) + _generate_version(version, url) + + if __name__ == "__main__": main() diff --git a/bin/model.jinja2 b/bin/model.jinja2 index 0658f10..d2d5803 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -8,7 +8,7 @@ import datetime from k8s.base import Model from k8s.fields import Field, ListField {% for import in module.imports %} -from k8s.models.{{ import.module.ref }} import {{ import.names|join(", ") }} +from k8s.models.{{ version }}.{{ import.module.ref }} import {{ import.names|join(", ") }} {% endfor %} {% for model in module.models %} From c530dbed72114077a9f736f19b5094a427d6a51c Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 8 Jan 2019 12:57:35 +0100 Subject: [PATCH 12/25] Use knowledge from later versions to fix v1.6 actions --- bin/generator.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index cca4f4e..c6c61a3 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -35,6 +35,9 @@ "UUID": "str", } REF_PATTERN = re.compile(r"io\.k8s\.(.+)") +OPERATION_ID_TO_ACTION = {} +OPERATION_ID_TO_GVK = {} + GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) @@ -285,8 +288,7 @@ def _parse_operations(self): for method, operation in item.items(): if self._should_ignore_method(method): continue - action = operation.get("x-kubernetes-action", "__undefined__") - action = self._rename_action(action, path) + action = self._resolve_action(operation, path) if self._should_ignore_action(action): continue gvk = self._resolve_gvk(operation) @@ -320,12 +322,24 @@ def _rename_action(action, path): def _should_ignore_action(action): return action in ("__undefined__", "patch", "deletecollection", "proxy", "connect") + def _resolve_action(self, operation, path): + op_id = operation.get("operationId") + action = operation.get("x-kubernetes-action", "__undefined__") + action = self._rename_action(action, path) + if action == "__undefined__": + return OPERATION_ID_TO_ACTION.get(op_id, action) + OPERATION_ID_TO_ACTION[op_id] = action + return action + @staticmethod def _resolve_gvk(operation): - if not "x-kubernetes-group-version-kind" in operation: - return None - gvk = operation["x-kubernetes-group-version-kind"] - return GVK(gvk["group"], gvk["version"], gvk["kind"]) + op_id = operation.get("operationId") + if "x-kubernetes-group-version-kind" not in operation: + return OPERATION_ID_TO_GVK.get(op_id) + gvk_data = operation["x-kubernetes-group-version-kind"] + gvk = GVK(gvk_data["group"], gvk_data["version"], gvk_data["kind"]) + OPERATION_ID_TO_GVK[op_id] = gvk + return gvk class Generator(object): @@ -398,7 +412,7 @@ def _generate_version(version, url): def main(): - for minor_version in range(*VERSION_RANGE): + for minor_version in reversed(range(*VERSION_RANGE)): version = "v1_{}".format(minor_version) url = URL_TEMPLATE.format(minor_version) _generate_version(version, url) From 84b3b2d090e9febf44694fb3d8dc8b1b32601787 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Tue, 8 Jan 2019 15:03:34 +0100 Subject: [PATCH 13/25] Shorten refs again --- bin/generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/generator.py b/bin/generator.py index c6c61a3..69c9388 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -87,7 +87,8 @@ def shorten_ref(id): m = REF_PATTERN.search(id) if not m: raise RuntimeError("Invalid id: {}".format(id)) - return m.group(1) + ref = m.group(1) + return ref.replace(".pkg", "") class PackageParser(object): From edae0b31e2543f974047496d5e34076398d62375 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 12:02:47 +0100 Subject: [PATCH 14/25] Update base to use new url-templates, fix (almost) all tests. --- .prospector.yaml | 3 + bin/generator.py | 13 +- k8s/base.py | 79 +- k8s/models/autoscaler.py | 30 - k8s/models/common.py | 36 - k8s/models/configmap.py | 14 - k8s/models/custom_resource_definition.py | 56 - k8s/models/deployment.py | 52 - k8s/models/enums.py | 14 + k8s/models/ingress.py | 49 - k8s/models/job.py | 31 - k8s/models/namespace.py | 22 - k8s/models/pod.py | 222 -- k8s/models/pod_disruption_budget.py | 35 - k8s/models/replication_controller.py | 23 - k8s/models/resourcequota.py | 35 - k8s/models/service.py | 37 - k8s/models/third_party_resource.py | 22 - k8s/models/v1_6/__init__.py | 1 + k8s/models/v1_6/apimachinery/__init__.py | 1 + k8s/models/v1_6/apimachinery/apis/__init__.py | 1 + .../v1_6/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_6/apimachinery/apis/meta/v1.py | 222 ++ k8s/models/v1_6/apimachinery/runtime.py | 58 + k8s/models/v1_6/apimachinery/version.py | 26 + k8s/models/v1_6/kubernetes/__init__.py | 1 + k8s/models/v1_6/kubernetes/api/__init__.py | 1 + k8s/models/v1_6/kubernetes/api/v1.py | 1950 ++++++++++++++++ k8s/models/v1_6/kubernetes/apis/__init__.py | 1 + .../v1_6/kubernetes/apis/apps/__init__.py | 1 + .../v1_6/kubernetes/apis/apps/v1beta1.py | 219 ++ .../apis/authentication/__init__.py | 1 + .../v1_6/kubernetes/apis/authentication/v1.py | 57 + .../kubernetes/apis/authentication/v1beta1.py | 57 + .../kubernetes/apis/authorization/__init__.py | 1 + .../v1_6/kubernetes/apis/authorization/v1.py | 121 + .../kubernetes/apis/authorization/v1beta1.py | 121 + .../kubernetes/apis/autoscaling/__init__.py | 1 + .../v1_6/kubernetes/apis/autoscaling/v1.py | 107 + .../kubernetes/apis/autoscaling/v2alpha1.py | 178 ++ .../v1_6/kubernetes/apis/batch/__init__.py | 1 + k8s/models/v1_6/kubernetes/apis/batch/v1.py | 86 + .../v1_6/kubernetes/apis/batch/v2alpha1.py | 82 + .../kubernetes/apis/certificates/__init__.py | 1 + .../kubernetes/apis/certificates/v1beta1.py | 80 + .../kubernetes/apis/extensions/__init__.py | 1 + .../kubernetes/apis/extensions/v1beta1.py | 636 ++++++ .../v1_6/kubernetes/apis/policy/__init__.py | 1 + .../v1_6/kubernetes/apis/policy/v1beta1.py | 81 + .../v1_6/kubernetes/apis/rbac/__init__.py | 1 + .../v1_6/kubernetes/apis/rbac/v1alpha1.py | 182 ++ .../v1_6/kubernetes/apis/rbac/v1beta1.py | 183 ++ .../v1_6/kubernetes/apis/settings/__init__.py | 1 + .../v1_6/kubernetes/apis/settings/v1alpha1.py | 57 + .../v1_6/kubernetes/apis/storage/__init__.py | 1 + k8s/models/v1_6/kubernetes/apis/storage/v1.py | 47 + .../v1_6/kubernetes/apis/storage/v1beta1.py | 47 + k8s/models/v1_7/__init__.py | 1 + k8s/models/v1_7/apimachinery/__init__.py | 1 + k8s/models/v1_7/apimachinery/apis/__init__.py | 1 + .../v1_7/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_7/apimachinery/apis/meta/v1.py | 257 +++ k8s/models/v1_7/apimachinery/runtime.py | 58 + k8s/models/v1_7/apimachinery/version.py | 26 + k8s/models/v1_7/kube_aggregator/__init__.py | 1 + .../v1_7/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1beta1.py | 77 + k8s/models/v1_7/kubernetes/__init__.py | 1 + k8s/models/v1_7/kubernetes/api/__init__.py | 1 + k8s/models/v1_7/kubernetes/api/v1.py | 2008 +++++++++++++++++ k8s/models/v1_7/kubernetes/apis/__init__.py | 1 + .../apis/admissionregistration/__init__.py | 1 + .../apis/admissionregistration/v1alpha1.py | 138 ++ .../v1_7/kubernetes/apis/apps/__init__.py | 1 + .../v1_7/kubernetes/apis/apps/v1beta1.py | 292 +++ .../apis/authentication/__init__.py | 1 + .../v1_7/kubernetes/apis/authentication/v1.py | 57 + .../kubernetes/apis/authentication/v1beta1.py | 57 + .../kubernetes/apis/authorization/__init__.py | 1 + .../v1_7/kubernetes/apis/authorization/v1.py | 121 + .../kubernetes/apis/authorization/v1beta1.py | 121 + .../kubernetes/apis/autoscaling/__init__.py | 1 + .../v1_7/kubernetes/apis/autoscaling/v1.py | 107 + .../kubernetes/apis/autoscaling/v2alpha1.py | 192 ++ .../v1_7/kubernetes/apis/batch/__init__.py | 1 + k8s/models/v1_7/kubernetes/apis/batch/v1.py | 86 + .../v1_7/kubernetes/apis/batch/v2alpha1.py | 82 + .../kubernetes/apis/certificates/__init__.py | 1 + .../kubernetes/apis/certificates/v1beta1.py | 80 + .../kubernetes/apis/extensions/__init__.py | 1 + .../kubernetes/apis/extensions/v1beta1.py | 639 ++++++ .../kubernetes/apis/networking/__init__.py | 1 + .../v1_7/kubernetes/apis/networking/v1.py | 82 + .../v1_7/kubernetes/apis/policy/__init__.py | 1 + .../v1_7/kubernetes/apis/policy/v1beta1.py | 85 + .../v1_7/kubernetes/apis/rbac/__init__.py | 1 + .../v1_7/kubernetes/apis/rbac/v1alpha1.py | 182 ++ .../v1_7/kubernetes/apis/rbac/v1beta1.py | 183 ++ .../v1_7/kubernetes/apis/settings/__init__.py | 1 + .../v1_7/kubernetes/apis/settings/v1alpha1.py | 57 + .../v1_7/kubernetes/apis/storage/__init__.py | 1 + k8s/models/v1_7/kubernetes/apis/storage/v1.py | 47 + .../v1_7/kubernetes/apis/storage/v1beta1.py | 47 + setup.py | 9 +- tests/k8s/test_client.py | 45 +- tests/k8s/test_configmap.py | 20 +- tests/k8s/test_deployer.py | 25 +- tests/k8s/test_fields.py | 2 +- tests/k8s/test_ingress.py | 18 +- tests/k8s/test_job.py | 13 +- tests/k8s/test_model.py | 13 +- tests/k8s/test_pod.py | 16 +- tests/k8s/test_resourcequota.py | 27 +- tests/k8s/test_service.py | 45 +- tests/k8s/test_watcher.py | 2 +- 116 files changed, 9929 insertions(+), 798 deletions(-) delete mode 100644 k8s/models/autoscaler.py delete mode 100644 k8s/models/common.py delete mode 100644 k8s/models/configmap.py delete mode 100644 k8s/models/custom_resource_definition.py delete mode 100644 k8s/models/deployment.py create mode 100644 k8s/models/enums.py delete mode 100644 k8s/models/ingress.py delete mode 100644 k8s/models/job.py delete mode 100644 k8s/models/namespace.py delete mode 100644 k8s/models/pod.py delete mode 100644 k8s/models/pod_disruption_budget.py delete mode 100644 k8s/models/replication_controller.py delete mode 100644 k8s/models/resourcequota.py delete mode 100644 k8s/models/service.py delete mode 100644 k8s/models/third_party_resource.py create mode 100644 k8s/models/v1_6/__init__.py create mode 100644 k8s/models/v1_6/apimachinery/__init__.py create mode 100644 k8s/models/v1_6/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_6/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_6/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_6/apimachinery/runtime.py create mode 100644 k8s/models/v1_6/apimachinery/version.py create mode 100644 k8s/models/v1_6/kubernetes/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/api/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/api/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/apps/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authentication/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authentication/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authorization/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authorization/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/autoscaling/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/batch/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/batch/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/certificates/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/extensions/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/policy/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/rbac/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/settings/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/storage/__init__.py create mode 100644 k8s/models/v1_6/kubernetes/apis/storage/v1.py create mode 100644 k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py create mode 100644 k8s/models/v1_7/__init__.py create mode 100644 k8s/models/v1_7/apimachinery/__init__.py create mode 100644 k8s/models/v1_7/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_7/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_7/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_7/apimachinery/runtime.py create mode 100644 k8s/models/v1_7/apimachinery/version.py create mode 100644 k8s/models/v1_7/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_7/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_7/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/api/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/api/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/admissionregistration/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/apps/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authentication/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authentication/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authorization/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authorization/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/autoscaling/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/batch/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/batch/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/certificates/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/extensions/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/networking/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/networking/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/policy/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/rbac/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/settings/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/storage/__init__.py create mode 100644 k8s/models/v1_7/kubernetes/apis/storage/v1.py create mode 100644 k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py diff --git a/.prospector.yaml b/.prospector.yaml index c88fdaa..7d649a3 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -11,6 +11,9 @@ ignore-paths: - .tox - .cachedocs +ignore-patterns: + - ^k8s/models/v1_.* + pep8: options: max-line-length: 120 diff --git a/bin/generator.py b/bin/generator.py index 69c9388..55e74d1 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -14,7 +14,7 @@ from jinja2 import Environment, FileSystemLoader URL_TEMPLATE = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.{}/api/openapi-spec/swagger.json" -VERSION_RANGE = (6, 14) +VERSION_RANGE = (6, 8) HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -37,7 +37,9 @@ REF_PATTERN = re.compile(r"io\.k8s\.(.+)") OPERATION_ID_TO_ACTION = {} OPERATION_ID_TO_GVK = {} - +PYTHON2_KEYWORDS = ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', + 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', + 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'] GVK = namedtuple("GVK", ("group", "version", "kind")) Field = namedtuple("Field", ("name", "description", "type", "ref", "cls", "alt_type")) @@ -206,13 +208,16 @@ def _resolve_fields(self, definition): for field in definition.fields: if field.ref and shorten_ref(field.ref) in self._UNION_TYPES: new_type, new_alt_type = self._UNION_TYPES[shorten_ref(field.ref)] - new_fields.append(field._replace(type=new_type, alt_type=new_alt_type)) + new_field = field._replace(type=new_type, alt_type=new_alt_type) else: if field.ref: field_type = self.resolve_ref(field.ref) else: field_type = self._resolve_field(field.type) - new_fields.append(field._replace(type=field_type)) + new_field = field._replace(type=field_type) + if new_field.name in PYTHON2_KEYWORDS: + new_field = new_field._replace(name="_{}".format(new_field.name)) + new_fields.append(new_field) definition.fields[:] = new_fields def resolve_ref(self, ref): diff --git a/k8s/base.py b/k8s/base.py index b8c8c0f..36cc8bf 100644 --- a/k8s/base.py +++ b/k8s/base.py @@ -14,6 +14,18 @@ LOG = logging.getLogger(__name__) LOG.addHandler(logging.NullHandler()) +URL_FIELDS = ( + "create_url", + "delete_url", + "get_url", + "update_url", + "list_all_url", + "list_ns_url", + "watch_url", + "watchlist_all_url", + "watchlist_ns_url", +) + class MetaModel(type): """Metaclass for Model @@ -33,13 +45,11 @@ def __new__(mcs, cls, bases, attrs): if attr_meta: bases += (ApiMixIn,) meta = { - "url_template": getattr(attr_meta, "url_template", ""), - "list_url": getattr(attr_meta, "list_url", ""), - "watch_list_url": getattr(attr_meta, "watch_list_url", ""), - "watch_list_url_template": getattr(attr_meta, "watch_list_url_template", ""), "fields": [], "field_names": [] } + for url_field in URL_FIELDS: + meta[url_field] = getattr(attr_meta, url_field, "") field_names = meta["field_names"] fields = meta["fields"] for k, v in list(attrs.items()): @@ -59,18 +69,14 @@ class ApiMixIn(object): """ _client = Client() - @classmethod - def _build_url(cls, **kwargs): - return cls._meta.url_template.format(**kwargs) - @classmethod def find(cls, name, namespace="default", labels=None): if namespace is None: - if not cls._meta.list_url: - raise NotImplementedError("Cannot find without namespace, no list_url defined on class {}".format(cls)) - url = cls._meta.list_url + url = cls._meta.list_all_url else: - url = cls._build_url(name="", namespace=namespace) + url = cls._meta.list_ns_url.format(namespace=namespace) + if not url: + raise NotImplementedError("No URL defined for find on {}".format(cls.__name__)) if labels: selector = ",".join("{}={}".format(k, v) for k, v in labels.items()) else: @@ -81,11 +87,11 @@ def find(cls, name, namespace="default", labels=None): @classmethod def list(cls, namespace="default"): if namespace is None: - if not cls._meta.list_url: - raise NotImplementedError("Cannot list without namespace, no list_url defined on class {}".format(cls)) - url = cls._meta.list_url + url = cls._meta.list_all_url else: - url = cls._build_url(name="", namespace=namespace) + url = cls._meta.list_ns_url.format(namespace=namespace) + if not url: + raise NotImplementedError("No URL defined for list on {}".format(cls.__name__)) resp = cls._client.get(url) return [cls.from_dict(item) for item in resp.json()[u"items"]] @@ -93,16 +99,24 @@ def list(cls, namespace="default"): def watch_list(cls, namespace=None): """Return a generator that yields WatchEvents of cls""" if namespace: - if cls._meta.watch_list_url_template: - url = cls._meta.watch_list_url_template.format(namespace=namespace) - else: - raise NotImplementedError( - "Cannot watch_list with namespace, no watch_list_url_template defined on class {}".format(cls)) + url = cls._meta.watchlist_ns_url.format(namespace=namespace) else: - url = cls._meta.watch_list_url - if not url: - raise NotImplementedError("Cannot watch_list, no watch_list_url defined on class {}".format(cls)) + url = cls._meta.watchlist_all_url + if not url: + raise NotImplementedError("No URL defined for watch_list on {}".format(cls.__name__)) + for event in cls._watch(url): + yield event + + @classmethod + def watch(cls, name, namespace="default"): + url = cls._meta.watch_url.format(name=name, namespace=namespace) + if not url: + raise NotImplementedError("No URL defined for watch on {}".format(cls.__name__)) + for event in cls._watch(url): + yield event + @classmethod + def _watch(cls, url): resp = cls._client.get(url, stream=True, timeout=None) for line in resp.iter_lines(chunk_size=None): if line: @@ -116,7 +130,9 @@ def watch_list(cls, namespace=None): @classmethod def get(cls, name, namespace="default"): """Get from API server if it exists""" - url = cls._build_url(name=name, namespace=namespace) + url = cls._meta.get_url.format(name=name, namespace=namespace) + if not url: + raise NotImplementedError("No URL defined for get on {}".format(cls.__name__)) resp = cls._client.get(url) instance = cls.from_dict(resp.json()) return instance @@ -135,17 +151,23 @@ def get_or_create(cls, **kwargs): @classmethod def delete(cls, name, namespace="default", **kwargs): - url = cls._build_url(name=name, namespace=namespace) + url = cls._meta.delete_url.format(name=name, namespace=namespace) + if not url: + raise NotImplementedError("No URL defined for delete on {}".format(cls.__name__)) cls._client.delete(url, **kwargs) def save(self): """Save to API server, either update if existing, or create if new""" if self._new: - url = self._build_url(name="", namespace=self.metadata.namespace) + url = self._meta.create_url.format(namespace=self.metadata.namespace) + if not url: + raise NotImplementedError("No URL defined for save on {}".format(self.__class__.__name__)) resp = self._client.post(url, self.as_dict()) self._new = False else: - url = self._build_url(name=self.metadata.name, namespace=self.metadata.namespace) + url = self._meta.update_url.format(name=self.metadata.name, namespace=self.metadata.namespace) + if not url: + raise NotImplementedError("No URL defined for save on {}".format(self.__class__.__name__)) resp = self._client.put(url, self.as_dict()) self.update_from_dict(resp.json()) @@ -187,6 +209,7 @@ def as_dict(self): def merge(self, other): for field in self._meta.fields: setattr(self, field.name, getattr(other, field.name)) + update = merge # For backwards compatibility def update_from_dict(self, d): diff --git a/k8s/models/autoscaler.py b/k8s/models/autoscaler.py deleted file mode 100644 index a6e4b6c..0000000 --- a/k8s/models/autoscaler.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from ..base import Model -from ..fields import Field, RequiredField -from .common import ObjectMeta - - -class CrossVersionObjectReference(Model): - kind = RequiredField(six.text_type) - name = RequiredField(six.text_type) - apiVersion = Field(six.text_type) - - -class HorizontalPodAutoscalerSpec(Model): - scaleTargetRef = RequiredField(CrossVersionObjectReference) - minReplicas = Field(int, 2) - maxReplicas = RequiredField(int) - targetCPUUtilizationPercentage = Field(int, 50) - - -class HorizontalPodAutoscaler(Model): - class Meta: - url_template = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" - - metadata = Field(ObjectMeta) - spec = Field(HorizontalPodAutoscalerSpec) diff --git a/k8s/models/common.py b/k8s/models/common.py deleted file mode 100644 index 0731b31..0000000 --- a/k8s/models/common.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import datetime - -import six - -from ..base import Model -from ..fields import Field, ReadOnlyField, ListField - - -class OwnerReference(Model): - apiVersion = Field(six.text_type) - blockOwnerDeletion = Field(bool) - controller = Field(bool) - kind = Field(six.text_type) - name = Field(six.text_type) - uid = Field(six.text_type) - - -class ObjectMeta(Model): - annotations = Field(dict) - creationTimestamp = ReadOnlyField(datetime.datetime) - deletionGracePeriodSeconds = ReadOnlyField(int) - deletionTimestamp = ReadOnlyField(datetime.datetime) - finalizers = ListField(six.text_type) - generateName = Field(six.text_type) - generation = ReadOnlyField(int) - labels = Field(dict) - name = Field(six.text_type) - namespace = Field(six.text_type, "default") - ownerReferences = ListField(OwnerReference) - resourceVersion = ReadOnlyField(six.text_type) - selfLink = ReadOnlyField(six.text_type) - uid = ReadOnlyField(six.text_type) diff --git a/k8s/models/configmap.py b/k8s/models/configmap.py deleted file mode 100644 index 602257c..0000000 --- a/k8s/models/configmap.py +++ /dev/null @@ -1,14 +0,0 @@ -from __future__ import absolute_import - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field - - -class ConfigMap(Model): - class Meta: - list_url = "/api/v1/configmaps" - url_template = "/api/v1/namespaces/{namespace}/configmaps/{name}" - - metadata = Field(ObjectMeta) - data = Field(dict) diff --git a/k8s/models/custom_resource_definition.py b/k8s/models/custom_resource_definition.py deleted file mode 100644 index 507e18b..0000000 --- a/k8s/models/custom_resource_definition.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import datetime - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -class CustomResourceDefinitionNames(Model): - kind = Field(six.text_type) - listKind = Field(six.text_type) - plural = Field(six.text_type) - shortNames = ListField(six.text_type) - singular = Field(six.text_type) - - -class CustomResourceValidation(Model): - # This field is fully defined in the API Reference, but in essence it is simply a JSON-schema - # following Specification Draft 4 (http://json-schema.org/) - openAPIV3Schema = Field(dict) - - -class CustomResourceDefinitionSpec(Model): - group = Field(six.text_type) - names = Field(CustomResourceDefinitionNames) - scope = Field(six.text_type) - validation = Field(CustomResourceValidation) - version = Field(six.text_type) - - -class CustomResourceDefinitionCondition(Model): - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) - - -class CustomResourceDefinitionStatus(Model): - acceptedNames = Field(CustomResourceDefinitionNames) - conditions = ListField(CustomResourceDefinitionCondition) - - -class CustomResourceDefinition(Model): - class Meta: - url_template = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" - watch_list_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - - metadata = Field(ObjectMeta) - spec = Field(CustomResourceDefinitionSpec) - status = Field(CustomResourceDefinitionStatus) diff --git a/k8s/models/deployment.py b/k8s/models/deployment.py deleted file mode 100644 index 7ecf8e2..0000000 --- a/k8s/models/deployment.py +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from .pod import PodTemplateSpec -from ..base import Model -from ..fields import Field - - -class LabelSelector(Model): - matchLabels = Field(dict) - - -class RollingUpdateDeployment(Model): - maxUnavailable = Field(int, alt_type=six.text_type) - maxSurge = Field(int, alt_type=six.text_type) - - -class DeploymentStrategy(Model): - type = Field(six.text_type, "RollingUpdate") - rollingUpdate = Field(RollingUpdateDeployment) - - -class DeploymentSpec(Model): - replicas = Field(int, 1) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) - strategy = Field(DeploymentStrategy) - minReadySeconds = Field(six.text_type, alt_type=int) - revisionHistoryLimit = Field(int) - paused = Field(six.text_type) - - -class DeploymentStatus(Model): - observedGeneration = Field(int) - replicas = Field(int) - updatedReplicas = Field(int) - availableReplicas = Field(int) - unavailableReplicas = Field(int) - - -class Deployment(Model): - class Meta: - list_url = "/apis/extensions/v1beta1/deployments" - url_template = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - - metadata = Field(ObjectMeta) - spec = Field(DeploymentSpec) - status = Field(DeploymentStatus) diff --git a/k8s/models/enums.py b/k8s/models/enums.py new file mode 100644 index 0000000..d7f4ae4 --- /dev/null +++ b/k8s/models/enums.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +# -*- coding: utf-8 + + +def _Enum(name, attrs): + return type(name, (object,), {a: a for a in attrs}) + + +ResourceQuotaScope = _Enum("ResourceQuota", ( + "Terminating", + "NotTerminating", + "BestEffort", + "NotBestEffort", +)) diff --git a/k8s/models/ingress.py b/k8s/models/ingress.py deleted file mode 100644 index 936c5b0..0000000 --- a/k8s/models/ingress.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -class IngressBackend(Model): - serviceName = Field(six.text_type) - servicePort = Field(six.text_type) - - -class HTTPIngressPath(Model): - path = Field(six.text_type) - backend = Field(IngressBackend) - - -class HTTPIngressRuleValue(Model): - paths = ListField(HTTPIngressPath) - - -class IngressRule(Model): - host = Field(six.text_type) - http = Field(HTTPIngressRuleValue) - - -class IngressTLS(Model): - hosts = ListField(six.text_type) - secretName = Field(six.text_type) - - -class IngressSpec(Model): - backend = Field(IngressBackend) - rules = ListField(IngressRule) - tls = ListField(IngressTLS) - - -class Ingress(Model): - class Meta: - list_url = "/apis/extensions/v1beta1/ingresses" - url_template = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" - watch_list_url = "/apis/extensions/v1beta1/watch/ingresses" - - metadata = Field(ObjectMeta) - spec = Field(IngressSpec) diff --git a/k8s/models/job.py b/k8s/models/job.py deleted file mode 100644 index 7a29465..0000000 --- a/k8s/models/job.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -from .pod import PodTemplateSpec -from .common import ObjectMeta -from ..base import Model -from ..fields import Field - - -class LabelSelector(Model): - matchLabels = Field(dict) - - -class JobSpec(Model): - template = Field(PodTemplateSpec) - backoffLimit = Field(int) - activeDeadlineSeconds = Field(int) - completions = Field(int) - manualSelector = Field(bool) - parallelism = Field(int) - selector = Field(LabelSelector) - - -class Job(Model): - class Meta: - list_url = "/apis/batch/v1/jobs" - url_template = "/apis/batch/v1/namespaces/{namespace}/jobs" - - metadata = Field(ObjectMeta) - spec = Field(JobSpec) diff --git a/k8s/models/namespace.py b/k8s/models/namespace.py deleted file mode 100644 index d4a1775..0000000 --- a/k8s/models/namespace.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -class NamespaceSpec(Model): - finalizers = ListField(six.text_type) - - -class Namespace(Model): - class Meta: - list_url = "/api/v1/namespaces" - url_template = "/api/v1/namespaces/{name}" - - metadata = Field(ObjectMeta) - spec = Field(NamespaceSpec) diff --git a/k8s/models/pod.py b/k8s/models/pod.py deleted file mode 100644 index 7624230..0000000 --- a/k8s/models/pod.py +++ /dev/null @@ -1,222 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField, RequiredField - - -class ContainerPort(Model): - name = Field(six.text_type) - hostPort = Field(int) - containerPort = Field(int) - protocol = Field(six.text_type, "TCP") - - -class ObjectFieldSelector(Model): - apiVersion = Field(six.text_type) - fieldPath = RequiredField(six.text_type) - - -class ResourceFieldSelector(Model): - containerName = Field(six.text_type) - resource = RequiredField(six.text_type) - divisor = Field(six.text_type) - - -class ConfigMapKeySelector(Model): - name = Field(six.text_type) - key = RequiredField(six.text_type) - - -class SecretKeySelector(Model): - name = Field(six.text_type) - key = RequiredField(six.text_type) - - -class EnvVarSource(Model): - fieldRef = Field(ObjectFieldSelector) - resourceFieldRef = Field(ResourceFieldSelector) - configMapKeyRef = Field(ConfigMapKeySelector) - secretKeyRef = Field(SecretKeySelector) - - -class SecretEnvSource(Model): - name = Field(six.text_type) - optional = Field(bool) - - -class ConfigMapEnvSource(Model): - name = Field(six.text_type) - optional = Field(bool) - - -class EnvFromSource(Model): - configMapRef = Field(ConfigMapEnvSource) - secretRef = Field(SecretEnvSource) - - -class EnvVar(Model): - name = Field(six.text_type) - value = Field(six.text_type) - valueFrom = Field(EnvVarSource) - - -class ResourceRequirements(Model): - limits = Field(dict) - requests = Field(dict) - - -class VolumeMount(Model): - name = Field(six.text_type) - readOnly = Field(bool) - mountPath = Field(six.text_type) - - -class HTTPHeader(Model): - name = Field(six.text_type) - value = Field(six.text_type) - - -class HTTPGetAction(Model): - path = Field(six.text_type) - port = Field(six.text_type, alt_type=int) - scheme = Field(six.text_type, "HTTP") - httpHeaders = ListField(HTTPHeader) - - -class TCPSocketAction(Model): - port = Field(six.text_type, alt_type=int) - - -class ExecAction(Model): - command = Field(list) - - -class Probe(Model): - httpGet = Field(HTTPGetAction) - tcpSocket = Field(TCPSocketAction) - _exec = Field(ExecAction) - initialDelaySeconds = Field(int, 5) - timeoutSeconds = Field(int) - successThreshold = Field(int) - failureThreshold = Field(int) - periodSeconds = Field(int) - - -class Handler(Model): - httpGet = Field(HTTPGetAction) - tcpSocket = Field(TCPSocketAction) - _exec = Field(ExecAction) - - -class Lifecycle(Model): - postStart = Field(Handler) - preStop = Field(Handler) - - -class Container(Model): - name = Field(six.text_type) - image = Field(six.text_type) - ports = ListField(ContainerPort) - env = ListField(EnvVar) - envFrom = ListField(EnvFromSource) - resources = Field(ResourceRequirements) - volumeMounts = ListField(VolumeMount) - lifecycle = Field(Lifecycle) - livenessProbe = Field(Probe) - readinessProbe = Field(Probe) - imagePullPolicy = Field(six.text_type, "IfNotPresent") - command = ListField(six.text_type) - - -class SecretVolumeSource(Model): - secretName = Field(six.text_type) - optional = Field(bool) - defaultMode = Field(int) - - -class KeyToPath(Model): - key = RequiredField(six.text_type) - path = RequiredField(six.text_type) - - -class ConfigMapVolumeSource(Model): - name = Field(six.text_type) - optional = Field(bool) - defaultMode = Field(int) - - -class EmptyDirVolumeSource(Model): - medium = Field(six.text_type) - - -class NFSVolumeSource(Model): - path = Field(six.text_type) - readOnly = Field(bool) - server = Field(six.text_type) - - -class HostPathVolumeSource(Model): - path = Field(six.text_type) - - -class GCEPersistentDiskVolumeSource(Model): - fsType = Field(six.text_type) - partition = Field(int) - pdName = Field(six.text_type) - readOnly = Field(bool) - - -class AWSElasticBlockStoreVolumeSource(Model): - fsType = Field(six.text_type) - partition = Field(int) - readOnly = Field(bool) - volumeID = Field(six.text_type) - - -class Volume(Model): - name = Field(six.text_type) - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - configMap = Field(ConfigMapVolumeSource) - emptyDir = Field(EmptyDirVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - hostPath = Field(HostPathVolumeSource) - nfs = Field(NFSVolumeSource) - secret = Field(SecretVolumeSource) - - -class LocalObjectReference(Model): - name = Field(six.text_type) - - -class PodSpec(Model): - volumes = ListField(Volume) - containers = ListField(Container) - restartPolicy = Field(six.text_type, "Always") - terminationGracePeriodSeconds = Field(int) - activeDeadlineSeconds = Field(int) - dnsPolicy = Field(six.text_type, "ClusterFirst") - nodeSelector = Field(dict) - selector = Field(dict) - serviceAccountName = Field(six.text_type, "default") - automountServiceAccountToken = Field(bool) - imagePullSecrets = ListField(LocalObjectReference) - initContainers = ListField(Container) - - -class PodTemplateSpec(Model): - metadata = Field(ObjectMeta) - spec = Field(PodSpec) - - -class Pod(Model): - class Meta: - list_url = "/api/v1/pods" - url_template = "/api/v1/namespaces/{namespace}/pods/{name}" - - metadata = Field(ObjectMeta) - spec = Field(PodSpec) diff --git a/k8s/models/pod_disruption_budget.py b/k8s/models/pod_disruption_budget.py deleted file mode 100644 index 70b987b..0000000 --- a/k8s/models/pod_disruption_budget.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -class LabelSelectorRequirement(Model): - key = Field(six.text_type) - operator = Field(six.text_type) - values = ListField(six.text_type) - - -class LabelSelector(Model): - matchExpressions = Field(LabelSelectorRequirement) - matchLabels = Field(dict) - - -class PodDisruptionBudgetSpec(Model): - minAvailable = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - selector = Field(LabelSelector) - - -class PodDisruptionBudget(Model): - class Meta: - list_url = "/apis/policy/v1beta1/poddisruptionbudgets" - url_template = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" - - metadata = Field(ObjectMeta) - spec = Field(PodDisruptionBudgetSpec) diff --git a/k8s/models/replication_controller.py b/k8s/models/replication_controller.py deleted file mode 100644 index 8fd7533..0000000 --- a/k8s/models/replication_controller.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -from .common import ObjectMeta -from .pod import PodTemplateSpec -from ..base import Model -from ..fields import Field - - -class ReplicationControllerSpec(Model): - replicas = Field(int, 1) - selector = Field(dict) - template = Field(PodTemplateSpec) - - -class ReplicationController(Model): - class Meta: - list_url = "/api/v1/replicationcontrollers" - url_template = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" - - metadata = Field(ObjectMeta) - spec = Field(ReplicationControllerSpec) diff --git a/k8s/models/resourcequota.py b/k8s/models/resourcequota.py deleted file mode 100644 index 3b1ec70..0000000 --- a/k8s/models/resourcequota.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -Terminating = "Terminating" -NotTerminating = "NotTerminating" -BestEffort = "BestEffort" -NotBestEffort = "NotBestEffort" - - -class ResourceQuotaSpec(Model): - hard = Field(dict) - scopes = ListField(six.text_type) - - -class ResourceQuotaStatus(Model): - hard = Field(dict) - used = Field(dict) - - -class ResourceQuota(Model): - class Meta: - list_url = "/api/v1/resourcequotas" - url_template = "/api/v1/namespaces/{namespace}/resourcequotas" - - metadata = Field(ObjectMeta) - spec = Field(ResourceQuotaSpec) - status = Field(ResourceQuotaStatus) diff --git a/k8s/models/service.py b/k8s/models/service.py deleted file mode 100644 index 6438736..0000000 --- a/k8s/models/service.py +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, OnceField, ListField - - -class ServicePort(Model): - name = Field(six.text_type) - protocol = Field(six.text_type, "TCP") - port = Field(int) - targetPort = Field(six.text_type) - nodePort = Field(int) - - -class ServiceSpec(Model): - ports = ListField(ServicePort) - selector = Field(dict) - clusterIP = OnceField(six.text_type) - loadBalancerIP = OnceField(six.text_type) - type = Field(six.text_type, "ClusterIP") - sessionAffinity = Field(six.text_type, "None") - loadBalancerSourceRanges = ListField(six.text_type) - - -class Service(Model): - class Meta: - list_url = "/api/v1/services" - url_template = "/api/v1/namespaces/{namespace}/services/{name}" - watch_list_url = "/api/v1/watch/services" - - metadata = Field(ObjectMeta) - spec = Field(ServiceSpec) diff --git a/k8s/models/third_party_resource.py b/k8s/models/third_party_resource.py deleted file mode 100644 index bac546b..0000000 --- a/k8s/models/third_party_resource.py +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -from __future__ import absolute_import - -import six - -from .common import ObjectMeta -from ..base import Model -from ..fields import Field, ListField - - -class APIVersion(Model): - name = Field(six.text_type) - - -class ThirdPartyResource(Model): - class Meta: - url_template = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - - metadata = Field(ObjectMeta) - description = Field(six.text_type) - versions = ListField(APIVersion) diff --git a/k8s/models/v1_6/__init__.py b/k8s/models/v1_6/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/apimachinery/__init__.py b/k8s/models/v1_6/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/apimachinery/apis/__init__.py b/k8s/models/v1_6/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/apimachinery/apis/meta/__init__.py b/k8s/models/v1_6/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..3d12a7c --- /dev/null +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -0,0 +1,222 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.runtime import RawExtension + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + resourceVersion = Field(six.text_type) + selfLink = Field(six.text_type) + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + + object = Field(RawExtension) + type = Field(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = Field(six.text_type) + version = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = Field(six.text_type) + serverAddress = Field(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + + name = Field(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + + groups = ListField(APIGroup) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + name = Field(six.text_type) + namespaced = Field(bool) + shortNames = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + + groupVersion = Field(six.text_type) + resources = ListField(APIResource) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = Field(six.text_type) + uid = Field(six.text_type) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = Field(datetime.datetime) + deletionGracePeriodSeconds = Field(int) + deletionTimestamp = Field(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = Field(int) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = Field(six.text_type) + selfLink = Field(six.text_type) + uid = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = Field(six.text_type) + operator = Field(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + diff --git a/k8s/models/v1_6/apimachinery/runtime.py b/k8s/models/v1_6/apimachinery/runtime.py new file mode 100644 index 0000000..5110035 --- /dev/null +++ b/k8s/models/v1_6/apimachinery/runtime.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = Field(six.text_type) + diff --git a/k8s/models/v1_6/apimachinery/version.py b/k8s/models/v1_6/apimachinery/version.py new file mode 100644 index 0000000..c3457cb --- /dev/null +++ b/k8s/models/v1_6/apimachinery/version.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = Field(six.text_type) + compiler = Field(six.text_type) + gitCommit = Field(six.text_type) + gitTreeState = Field(six.text_type) + gitVersion = Field(six.text_type) + goVersion = Field(six.text_type) + major = Field(six.text_type) + minor = Field(six.text_type) + platform = Field(six.text_type) + diff --git a/k8s/models/v1_6/kubernetes/__init__.py b/k8s/models/v1_6/kubernetes/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/api/__init__.py b/k8s/models/v1_6/kubernetes/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py new file mode 100644 index 0000000..9018d40 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -0,0 +1,1950 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = Field(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = Field(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = Field(PodAffinityTerm) + weight = Field(int) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = Field(six.text_type) + revision = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = Field(six.text_type) + readOnly = Field(bool) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = Field(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopes = ListField(six.text_type) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = Field(six.text_type) + diskURI = Field(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = Field(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = Field(six.text_type) + operator = Field(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = Field(NodeSelectorTerm) + weight = Field(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + volumePath = Field(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = Field(six.text_type) + type = Field(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. + """ + + driver = Field(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = Field(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = Field(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = Field(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = Field(six.text_type) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class Binding(Model): + """ + Binding ties one object to another. For example, a pod is bound to a node by a + scheduler. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = Field(ObjectReference) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = Field(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = Field(six.text_type) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = Field(six.text_type) + mode = Field(int) + path = Field(six.text_type) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + port = Field(six.text_type, alt_type=int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = Field(six.text_type) + imageID = Field(six.text_type) + lastState = Field(ContainerState) + name = Field(six.text_type) + ready = Field(bool) + restartCount = Field(int) + state = Field(ContainerState) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + update_url = "/api/v1/namespaces/{name}/finalize" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = Field(six.text_type) + name = Field(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = Field(six.text_type) + readOnly = Field(bool) + server = Field(six.text_type) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = Field(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = Field(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + iqn = Field(six.text_type) + iscsiInterface = Field(six.text_type) + lun = Field(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + targetPortal = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = Field(six.text_type) + name = Field(six.text_type) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = Field(six.text_type) + user = Field(six.text_type) + volume = Field(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = Field(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = Field(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = Field(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = Field(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + deprecatedPublicIPs = ListField(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = Field(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = Field(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = Field(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = Field(six.text_type) + shareName = Field(six.text_type) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = Field(six.text_type) + bootID = Field(six.text_type) + containerRuntimeVersion = Field(six.text_type) + kernelVersion = Field(six.text_type) + kubeProxyVersion = Field(six.text_type) + kubeletVersion = Field(six.text_type) + machineID = Field(six.text_type) + operatingSystem = Field(six.text_type) + osImage = Field(six.text_type) + systemUUID = Field(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = Field(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = Field(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + storageClassName = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: http://kubernetes.io/docs/user-guide + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = Field(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = Field(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsPolicy = Field(six.text_type) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = Field(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = Field(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/__init__.py b/k8s/models/v1_6/kubernetes/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/apps/__init__.py b/k8s/models/v1_6/kubernetes/apis/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py new file mode 100644 index 0000000..63f5453 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import PersistentVolumeClaim, PodTemplateSpec + + +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = Field(six.text_type) + rollbackTo = Field(RollbackConfig) + updatedAnnotations = Field(dict) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = Field(PodTemplateSpec) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + replicas = Field(int) + selector = Field(LabelSelector) + serviceName = Field(six.text_type) + template = Field(PodTemplateSpec) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + observedGeneration = Field(int) + replicas = Field(int) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/__init__.py b/k8s/models/v1_6/kubernetes/apis/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py new file mode 100644 index 0000000..4d95be5 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = Field(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py new file mode 100644 index 0000000..57d6465 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = Field(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/__init__.py b/k8s/models/v1_6/kubernetes/apis/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py new file mode 100644 index 0000000..89d19b9 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py new file mode 100644 index 0000000..4791d6f --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/__init__.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py new file mode 100644 index 0000000..feffb50 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = Field(int) + desiredReplicas = Field(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = Field(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = Field(int) + minReplicas = Field(int) + scaleTargetRef = Field(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py new file mode 100644 index 0000000..551fd2e --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py @@ -0,0 +1,178 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = Field(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = Field(six.text_type) + metricName = Field(six.text_type) + target = Field(CrossVersionObjectReference) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = Field(six.text_type) + target = Field(CrossVersionObjectReference) + targetValue = Field(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = Field(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = Field(six.text_type) + name = Field(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = Field(six.text_type) + targetAverageValue = Field(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = Field(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = Field(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = Field(CrossVersionObjectReference) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = Field(six.text_type) + metricName = Field(six.text_type) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = Field(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + currentMetrics = ListField(MetricStatus) + currentReplicas = Field(int) + desiredReplicas = Field(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2alpha1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2alpha1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/batch/__init__.py b/k8s/models/v1_6/kubernetes/apis/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v1.py b/k8s/models/v1_6/kubernetes/apis/batch/v1.py new file mode 100644 index 0000000..b35a7be --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/batch/v1.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import PodTemplateSpec + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py new file mode 100644 index 0000000..2ab9904 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ObjectReference +from k8s.models.v1_6.kubernetes.apis.batch.v1 import JobSpec + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = Field(JobTemplateSpec) + schedule = Field(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "ScheduledJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "ScheduledJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/certificates/__init__.py b/k8s/models/v1_6/kubernetes/apis/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py new file mode 100644 index 0000000..25cb2cb --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = Field(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = Field(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/extensions/__init__.py b/k8s/models/v1_6/kubernetes/apis/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py new file mode 100644 index 0000000..fc1d8b3 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py @@ -0,0 +1,636 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = Field(six.text_type) + servicePort = Field(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = Field(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class NetworkPolicyPeer(Model): + """ + + """ + + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = Field(int) + min = Field(int) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = Field(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = Field(int) + min = Field(int) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowedCapabilities = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + fsGroup = Field(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = Field(RunAsUserStrategyOptions) + seLinux = Field(SELinuxStrategyOptions) + supplementalGroups = Field(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class NetworkPolicyIngressRule(Model): + """ + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicySpec(Model): + """ + + """ + + ingress = ListField(NetworkPolicyIngressRule) + podSelector = Field(LabelSelector) + + +class NetworkPolicy(Model): + """ + + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + Network Policy List is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class APIVersion(Model): + """ + An APIVersion represents a single concrete version of an object model. + """ + + name = Field(six.text_type) + + +class ThirdPartyResource(Model): + """ + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResource") + + description = Field(six.text_type) + metadata = Field(ObjectMeta) + versions = ListField(APIVersion) + + +class ThirdPartyResourceList(Model): + """ + ThirdPartyResourceList is a list of ThirdPartyResources. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResourceList") + + items = ListField(ThirdPartyResource) + metadata = Field(ListMeta) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = Field(six.text_type) + rollbackTo = Field(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = Field(PodTemplateSpec) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + currentNumberScheduled = Field(int) + desiredNumberScheduled = Field(int) + numberAvailable = Field(int) + numberMisscheduled = Field(int) + numberReady = Field(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = Field(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSet(Model): + """ + ReplicaSet represents the configuration of a ReplicaSet. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = Field(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/policy/__init__.py b/k8s/models/v1_6/kubernetes/apis/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py new file mode 100644 index 0000000..2158dca --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = Field(int) + desiredHealthy = Field(int) + disruptedPods = Field(dict) + disruptionsAllowed = Field(int) + expectedPods = Field(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/__init__.py b/k8s/models/v1_6/kubernetes/apis/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py new file mode 100644 index 0000000..b59e039 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py new file mode 100644 index 0000000..ff6ce99 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/settings/__init__.py b/k8s/models/v1_6/kubernetes/apis/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py new file mode 100644 index 0000000..5a24fef --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import EnvFromSource, EnvVar, Volume, VolumeMount + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod injection policy. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/storage/__init__.py b/k8s/models/v1_6/kubernetes/apis/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1.py new file mode 100644 index 0000000..1546e69 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + metadata = Field(ObjectMeta) + parameters = Field(dict) + provisioner = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py new file mode 100644 index 0000000..fb13d64 --- /dev/null +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + metadata = Field(ObjectMeta) + parameters = Field(dict) + provisioner = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/__init__.py b/k8s/models/v1_7/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/apimachinery/__init__.py b/k8s/models/v1_7/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/apimachinery/apis/__init__.py b/k8s/models/v1_7/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/apimachinery/apis/meta/__init__.py b/k8s/models/v1_7/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..568d961 --- /dev/null +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -0,0 +1,257 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.runtime import RawExtension + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + resourceVersion = Field(six.text_type) + selfLink = Field(six.text_type) + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "WatchEvent") + + object = Field(RawExtension) + type = Field(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = Field(six.text_type) + serverAddress = Field(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = Field(six.text_type) + version = Field(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = Field(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + name = Field(six.text_type) + namespaced = Field(bool) + shortNames = ListField(six.text_type) + singularName = Field(six.text_type) + verbs = ListField(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = Field(six.text_type) + resources = ListField(APIResource) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "DeleteOptions") + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = Field(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = Field(six.text_type) + operator = Field(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = Field(six.text_type) + uid = Field(six.text_type) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = Field(datetime.datetime) + deletionGracePeriodSeconds = Field(int) + deletionTimestamp = Field(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = Field(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = Field(six.text_type) + selfLink = Field(six.text_type) + uid = Field(six.text_type) + diff --git a/k8s/models/v1_7/apimachinery/runtime.py b/k8s/models/v1_7/apimachinery/runtime.py new file mode 100644 index 0000000..5110035 --- /dev/null +++ b/k8s/models/v1_7/apimachinery/runtime.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = Field(six.text_type) + diff --git a/k8s/models/v1_7/apimachinery/version.py b/k8s/models/v1_7/apimachinery/version.py new file mode 100644 index 0000000..c3457cb --- /dev/null +++ b/k8s/models/v1_7/apimachinery/version.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = Field(six.text_type) + compiler = Field(six.text_type) + gitCommit = Field(six.text_type) + gitTreeState = Field(six.text_type) + gitVersion = Field(six.text_type) + goVersion = Field(six.text_type) + major = Field(six.text_type) + minor = Field(six.text_type) + platform = Field(six.text_type) + diff --git a/k8s/models/v1_7/kube_aggregator/__init__.py b/k8s/models/v1_7/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kube_aggregator/apis/__init__.py b/k8s/models/v1_7/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..c84ff43 --- /dev/null +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = Field(int) + insecureSkipTLSVerify = Field(bool) + service = Field(ServiceReference) + version = Field(six.text_type) + versionPriority = Field(int) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/__init__.py b/k8s/models/v1_7/kubernetes/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/api/__init__.py b/k8s/models/v1_7/kubernetes/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py new file mode 100644 index 0000000..dcd3fca --- /dev/null +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -0,0 +1,2008 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = Field(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = Field(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = Field(PodAffinityTerm) + weight = Field(int) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = Field(six.text_type) + readOnly = Field(bool) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = Field(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopes = ListField(six.text_type) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity + """ + + path = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = Field(six.text_type) + operator = Field(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = Field(NodeSelectorTerm) + weight = Field(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = Field(six.text_type) + type = Field(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. + """ + + driver = Field(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = Field(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = Field(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = Field(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + iqn = Field(six.text_type) + iscsiInterface = Field(six.text_type) + lun = Field(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = Field(six.text_type) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = Field(ObjectReference) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = Field(six.text_type) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = Field(six.text_type) + mode = Field(int) + path = Field(six.text_type) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = Field(six.text_type, alt_type=int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = Field(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = Field(six.text_type) + imageID = Field(six.text_type) + lastState = Field(ContainerState) + name = Field(six.text_type) + ready = Field(bool) + restartCount = Field(int) + state = Field(ContainerState) + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}/finalize" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = Field(six.text_type) + name = Field(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = Field(six.text_type) + readOnly = Field(bool) + server = Field(six.text_type) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = Field(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = Field(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = Field(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = Field(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = Field(six.text_type) + name = Field(six.text_type) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = Field(six.text_type) + user = Field(six.text_type) + volume = Field(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = Field(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = Field(six.text_type) + diskURI = Field(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = Field(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = Field(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = Field(six.text_type) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = Field(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = Field(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = Field(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = Field(six.text_type) + shareName = Field(six.text_type) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = Field(six.text_type) + revision = Field(six.text_type) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = Field(six.text_type) + bootID = Field(six.text_type) + containerRuntimeVersion = Field(six.text_type) + kernelVersion = Field(six.text_type) + kubeProxyVersion = Field(six.text_type) + kubeletVersion = Field(six.text_type) + machineID = Field(six.text_type) + operatingSystem = Field(six.text_type) + osImage = Field(six.text_type) + systemUUID = Field(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = Field(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = Field(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + local = Field(LocalVolumeSource) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = Field(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = Field(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = Field(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = Field(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/__init__.py b/k8s/models/v1_7/kubernetes/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/admissionregistration/__init__.py b/k8s/models/v1_7/kubernetes/apis/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..9a272a2 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + failurePolicy = Field(six.text_type) + name = Field(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class AdmissionHookClientConfig(Model): + """ + AdmissionHookClientConfig contains the information to make a TLS connection + with the webhook + """ + + caBundle = Field(six.text_type) + service = Field(ServiceReference) + + +class ExternalAdmissionHook(Model): + """ + ExternalAdmissionHook describes an external admission webhook and the resources + and operations it applies to. + """ + + clientConfig = Field(AdmissionHookClientConfig) + failurePolicy = Field(six.text_type) + name = Field(six.text_type) + rules = ListField(RuleWithOperations) + + +class ExternalAdmissionHookConfiguration(Model): + """ + ExternalAdmissionHookConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "ExternalAdmissionHookConfiguration") + + externalAdmissionHooks = ListField(ExternalAdmissionHook) + metadata = Field(ObjectMeta) + + +class ExternalAdmissionHookConfigurationList(Model): + """ + ExternalAdmissionHookConfigurationList is a list of + ExternalAdmissionHookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "ExternalAdmissionHookConfigurationList") + + items = ListField(ExternalAdmissionHookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/apps/__init__.py b/k8s/models/v1_7/kubernetes/apis/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py new file mode 100644 index 0000000..54fa374 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py @@ -0,0 +1,292 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_7.apimachinery.runtime import RawExtension +from k8s.models.v1_7.kubernetes.api.v1 import PersistentVolumeClaim, PodTemplateSpec + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = Field(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = Field(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = Field(six.text_type) + rollbackTo = Field(RollbackConfig) + updatedAnnotations = Field(dict) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = Field(six.text_type) + template = Field(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/__init__.py b/k8s/models/v1_7/kubernetes/apis/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py new file mode 100644 index 0000000..bfff54f --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = Field(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py new file mode 100644 index 0000000..1f5caaa --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = Field(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/__init__.py b/k8s/models/v1_7/kubernetes/apis/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py new file mode 100644 index 0000000..9132dec --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py new file mode 100644 index 0000000..cb80978 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py @@ -0,0 +1,121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = Field(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/__init__.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py new file mode 100644 index 0000000..fe9fbf9 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py @@ -0,0 +1,107 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = Field(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = Field(int) + minReplicas = Field(int) + scaleTargetRef = Field(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = Field(int) + desiredReplicas = Field(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py new file mode 100644 index 0000000..807bf53 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py @@ -0,0 +1,192 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = Field(six.text_type) + name = Field(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = Field(six.text_type) + targetAverageValue = Field(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = Field(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = Field(six.text_type) + metricName = Field(six.text_type) + target = Field(CrossVersionObjectReference) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = Field(six.text_type) + target = Field(CrossVersionObjectReference) + targetValue = Field(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = Field(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = Field(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = Field(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = Field(CrossVersionObjectReference) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = Field(six.text_type) + metricName = Field(six.text_type) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = Field(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = Field(int) + desiredReplicas = Field(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2alpha1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2alpha1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/batch/__init__.py b/k8s/models/v1_7/kubernetes/apis/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v1.py b/k8s/models/v1_7/kubernetes/apis/batch/v1.py new file mode 100644 index 0000000..95bec9c --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/batch/v1.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_7.kubernetes.api.v1 import PodTemplateSpec + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py new file mode 100644 index 0000000..8f5b1e1 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +from k8s.models.v1_7.kubernetes.api.v1 import ObjectReference +from k8s.models.v1_7.kubernetes.apis.batch.v1 import JobSpec + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = Field(JobTemplateSpec) + schedule = Field(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "ScheduledJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "ScheduledJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/certificates/__init__.py b/k8s/models/v1_7/kubernetes/apis/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py new file mode 100644 index 0000000..e67076d --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py @@ -0,0 +1,80 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = Field(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = Field(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/extensions/__init__.py b/k8s/models/v1_7/kubernetes/apis/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py new file mode 100644 index 0000000..7df5366 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py @@ -0,0 +1,639 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_7.kubernetes.api.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = Field(six.text_type) + servicePort = Field(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = Field(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = Field(six.text_type) + rollbackTo = Field(RollbackConfig) + updatedAnnotations = Field(dict) + + +class NetworkPolicyPeer(Model): + """ + + """ + + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = Field(int) + min = Field(int) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = Field(six.text_type) + type = Field(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = Field(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = Field(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = Field(int) + min = Field(int) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowedCapabilities = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + fsGroup = Field(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = Field(RunAsUserStrategyOptions) + seLinux = Field(SELinuxStrategyOptions) + supplementalGroups = Field(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class NetworkPolicyIngressRule(Model): + """ + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicySpec(Model): + """ + + """ + + ingress = ListField(NetworkPolicyIngressRule) + podSelector = Field(LabelSelector) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + Network Policy List is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = Field(PodTemplateSpec) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class APIVersion(Model): + """ + An APIVersion represents a single concrete version of an object model. + """ + + name = Field(six.text_type) + + +class ThirdPartyResource(Model): + """ + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResource") + + description = Field(six.text_type) + metadata = Field(ObjectMeta) + versions = ListField(APIVersion) + + +class ThirdPartyResourceList(Model): + """ + ThirdPartyResourceList is a list of ThirdPartyResources. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResourceList") + + items = ListField(ThirdPartyResource) + metadata = Field(ListMeta) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = Field(ScaleStatus) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + currentNumberScheduled = Field(int) + desiredNumberScheduled = Field(int) + numberAvailable = Field(int) + numberMisscheduled = Field(int) + numberReady = Field(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = Field(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSet(Model): + """ + ReplicaSet represents the configuration of a ReplicaSet. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = Field(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/networking/__init__.py b/k8s/models/v1_7/kubernetes/apis/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/networking/v1.py b/k8s/models/v1_7/kubernetes/apis/networking/v1.py new file mode 100644 index 0000000..3368fb3 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/networking/v1.py @@ -0,0 +1,82 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its + fields must be specified. + """ + + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + ingress = ListField(NetworkPolicyIngressRule) + podSelector = Field(LabelSelector) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/policy/__init__.py b/k8s/models/v1_7/kubernetes/apis/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py new file mode 100644 index 0000000..e40361e --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = Field(int) + desiredHealthy = Field(int) + disruptedPods = Field(dict) + disruptionsAllowed = Field(int) + expectedPods = Field(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/__init__.py b/k8s/models/v1_7/kubernetes/apis/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py new file mode 100644 index 0000000..a468872 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py new file mode 100644 index 0000000..7a59443 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py @@ -0,0 +1,183 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = Field(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/settings/__init__.py b/k8s/models/v1_7/kubernetes/apis/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py new file mode 100644 index 0000000..639c694 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py @@ -0,0 +1,57 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_7.kubernetes.api.v1 import EnvFromSource, EnvVar, Volume, VolumeMount + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/storage/__init__.py b/k8s/models/v1_7/kubernetes/apis/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1.py new file mode 100644 index 0000000..f2fdb16 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + metadata = Field(ObjectMeta) + parameters = Field(dict) + provisioner = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py new file mode 100644 index 0000000..182c2b1 --- /dev/null +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + metadata = Field(ObjectMeta) + parameters = Field(dict) + provisioner = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/setup.py b/setup.py index 9a3a529..3c3bc03 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ "pytest-html==1.19.0", "pytest-cov==2.6.0", "pytest-helpers-namespace==2017.11.11", + "pytest-xdist==1.25.0", 'pytest==3.8.2', "GitPython==2.1.11", ] @@ -33,6 +34,12 @@ "prospector==1.1.2", ] +GENERATOR_REQ = [ + "appdirs==1.4.3", + "cachecontrol[filecache]==0.12.5", + "jinja2==2.10", +] + def _generate_description(): description = [_read("README.rst")] @@ -68,7 +75,7 @@ def main(): install_requires=GENERIC_REQ, setup_requires=['pytest-runner', 'wheel', 'setuptools_scm'], extras_require={ - "dev": TESTS_REQ + CODE_QUALITY_REQ + EXTRA_REQ, + "dev": TESTS_REQ + CODE_QUALITY_REQ + EXTRA_REQ + GENERATOR_REQ, "codacy": ["codacy-coverage"], "release": ["gitpython", "twine"], "docs": ["Sphinx>=1.6.3"] diff --git a/tests/k8s/test_client.py b/tests/k8s/test_client.py index d931f86..6dac152 100644 --- a/tests/k8s/test_client.py +++ b/tests/k8s/test_client.py @@ -97,13 +97,15 @@ def test_watch_list_with_namespace_should_raise_exception_when_watch_list_url_te def test_watch_list(self, session): list(WatchListExample.watch_list()) session.request.assert_called_once_with( - "GET", _absolute_url("/watch/example"), json=None, timeout=None, stream=True + "GET", _absolute_url(WatchListExample._meta.watchlist_all_url), json=None, timeout=None, stream=True ) def test_watch_list_with_namespace(self, session): - list(WatchListExample.watch_list(namespace="explicitly-set")) + namespace = "explicitly-set" + list(WatchListExample.watch_list(namespace=namespace)) session.request.assert_called_once_with( - "GET", _absolute_url("/watch/explicitly-set/example"), json=None, timeout=None, stream=True + "GET", _absolute_url(WatchListExample._meta.watchlist_ns_url.format(namespace=namespace)), json=None, + timeout=None, stream=True ) def test_list_without_namespace_should_raise_exception_when_list_url_is_not_set_on_metaclass(self, session): @@ -113,19 +115,22 @@ def test_list_without_namespace_should_raise_exception_when_list_url_is_not_set_ def test_list_default_namespace(self, session): WatchListExample.list() session.request.assert_called_once_with( - "GET", _absolute_url("/apis/namespaces/default/example"), json=None, timeout=config.timeout + "GET", _absolute_url(WatchListExample._meta.list_ns_url.format(namespace="default")), json=None, + timeout=config.timeout ) def test_list_explicit_namespace(self, session): - WatchListExample.list(namespace="explicitly-set") + namespace = "explicitly-set" + WatchListExample.list(namespace=namespace) session.request.assert_called_once_with( - "GET", _absolute_url("/apis/namespaces/explicitly-set/example"), json=None, timeout=config.timeout + "GET", _absolute_url(WatchListExample._meta.list_ns_url.format(namespace=namespace)), json=None, + timeout=config.timeout ) def test_list_without_namespace(self, session): WatchListExample.list(namespace=None) session.request.assert_called_once_with( - "GET", _absolute_url("/example/list"), json=None, timeout=config.timeout + "GET", _absolute_url(WatchListExample._meta.list_all_url), json=None, timeout=config.timeout ) def test_find_without_namespace_should_raise_exception_when_list_url_is_not_set_on_metaclass(self, session): @@ -135,21 +140,24 @@ def test_find_without_namespace_should_raise_exception_when_list_url_is_not_set_ def test_find_default_namespace(self, session): WatchListExample.find("foo") session.request.assert_called_once_with( - "GET", _absolute_url("/apis/namespaces/default/example"), json=None, timeout=config.timeout, + "GET", _absolute_url(WatchListExample._meta.list_ns_url.format(namespace="default")), json=None, + timeout=config.timeout, params={"labelSelector": "app=foo"} ) def test_find_explicit_namespace(self, session): - WatchListExample.find("foo", namespace="explicitly-set") + namespace = "explicitly-set" + WatchListExample.find("foo", namespace=namespace) session.request.assert_called_once_with( - "GET", _absolute_url("/apis/namespaces/explicitly-set/example"), json=None, timeout=config.timeout, + "GET", _absolute_url((WatchListExample._meta.list_ns_url.format(namespace=namespace))), json=None, + timeout=config.timeout, params={"labelSelector": "app=foo"} ) def test_find_without_namespace(self, session): WatchListExample.find("foo", namespace=None) session.request.assert_called_once_with( - "GET", _absolute_url("/example/list"), json=None, timeout=config.timeout, + "GET", _absolute_url(WatchListExample._meta.list_all_url), json=None, timeout=config.timeout, params={"labelSelector": "app=foo"} ) @@ -168,16 +176,21 @@ def _absolute_url(url): class WatchListExample(Model): class Meta: - list_url = "/example/list" - url_template = "/apis/namespaces/{namespace}/example" - watch_list_url = "/watch/example" - watch_list_url_template = "/watch/{namespace}/example" + create_url = "/apis/tests/v1/namespaces/{namespace}/watch_list_example" + delete_url = "/apis/tests/v1/namespaces/{namespace}/watch_list_example/{name}" + get_url = "/apis/tests/v1/namespaces/{namespace}/watch_list_example/{name}" + list_all_url = "/apis/tests/v1/watch_list_example" + list_ns_url = "/apis/tests/v1/namespaces/{namespace}/watch_list_example" + update_url = "/apis/tests/v1/namespaces/{namespace}/watch_list_example/{name}" + watch_url = "/apis/tests/v1/watch/namespaces/{namespace}/watch_list_example/{name}" + watchlist_all_url = "/apis/tests/v1/watch/watch_list_example" + watchlist_ns_url = "/apis/tests/v1/watch/namespaces/{namespace}/watch_list_example" value = Field(int) class WatchListExampleUnsupported(Model): class Meta: - url_template = "/example" + get_url = "/example" value = Field(int) diff --git a/tests/k8s/test_configmap.py b/tests/k8s/test_configmap.py index 96411f5..08a31ee 100644 --- a/tests/k8s/test_configmap.py +++ b/tests/k8s/test_configmap.py @@ -5,11 +5,15 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.configmap import ConfigMap +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ConfigMap NAME = "my-name" NAMESPACE = "my-namespace" +POST_URI = ConfigMap._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = ConfigMap._meta.update_url.format(name=NAME, namespace=NAMESPACE) +DELETE_URI = ConfigMap._meta.delete_url.format(name=NAME, namespace=NAMESPACE) +GET_URI = ConfigMap._meta.get_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") @@ -24,7 +28,7 @@ def test_created_if_not_exists(self, post, api_get): configmap.save() assert not configmap._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_updated_if_exists(self, get, put): mock_response = _create_mock_response() @@ -40,11 +44,11 @@ def test_updated_if_exists(self, get, put): put.return_value.json.return_value = call_params from_api.save() - pytest.helpers.assert_any_call(put, _uri(NAMESPACE, NAME), call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def test_deleted(self, delete): ConfigMap.delete(NAME, namespace=NAMESPACE) - pytest.helpers.assert_any_call(delete, _uri(NAMESPACE, NAME)) + pytest.helpers.assert_any_call(delete, DELETE_URI) def _create_mock_response(): @@ -61,7 +65,7 @@ def _create_mock_response(): "name": NAME, "namespace": NAMESPACE, "resourceVersion": "42", - "selfLink": _uri(NAMESPACE, NAME), + "selfLink": GET_URI, "uid": "d8f1ba26-b182-11e6-a364-fa163ea2a9c4" }, "data": { @@ -76,7 +80,3 @@ def _create_default_configmap(): data = {"foo": "bar"} configmap = ConfigMap(metadata=object_meta, data=data) return configmap - - -def _uri(namespace, name=""): - return "/api/v1/namespaces/{namespace}/configmaps/{name}".format(name=name, namespace=namespace) diff --git a/tests/k8s/test_deployer.py b/tests/k8s/test_deployer.py index 144e09e..d1c8918 100644 --- a/tests/k8s/test_deployer.py +++ b/tests/k8s/test_deployer.py @@ -6,14 +6,17 @@ from six import u from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.deployment import Deployment, DeploymentSpec, LabelSelector, RollingUpdateDeployment, \ - DeploymentStrategy -from k8s.models.pod import ContainerPort, Container, LocalObjectReference, Probe, HTTPGetAction, TCPSocketAction, \ - PodTemplateSpec, PodSpec +from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ContainerPort, HTTPGetAction, Probe, TCPSocketAction, \ + Container, LocalObjectReference, PodSpec, PodTemplateSpec +from k8s.models.v1_6.kubernetes.apis.extensions.v1beta1 import Deployment, RollingUpdateDeployment, \ + DeploymentStrategy, DeploymentSpec NAME = "my-name" NAMESPACE = "my-namespace" +POST_URI = Deployment._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = Deployment._meta.update_url.format(name=NAME, namespace=NAMESPACE) +DELETE_URI = Deployment._meta.delete_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") @@ -33,7 +36,7 @@ def test_created_if_not_exists(self, post, api_get): deployment.save() assert not deployment._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_created_if_not_exists_with_percentage_rollout_strategy(self, post, api_get): api_get.side_effect = NotFound() @@ -47,7 +50,7 @@ def test_created_if_not_exists_with_percentage_rollout_strategy(self, post, api_ deployment.save() assert not deployment._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_updated_if_exists(self, get, put): mock_response = _create_mock_response() @@ -61,11 +64,11 @@ def test_updated_if_exists(self, get, put): put.return_value.json.return_value = call_params from_api.save() - pytest.helpers.assert_any_call(put, _uri(NAMESPACE, NAME), call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def test_delete(self, delete): Deployment.delete(NAME, namespace=NAMESPACE) - pytest.helpers.assert_any_call(delete, _uri(NAMESPACE, NAME)) + pytest.helpers.assert_any_call(delete, DELETE_URI) def _create_default_deployment(): @@ -164,7 +167,3 @@ def _create_mock_response(): } } return mock_response - - -def _uri(namespace, name=""): - return "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}".format(name=name, namespace=namespace) diff --git a/tests/k8s/test_fields.py b/tests/k8s/test_fields.py index 12028dd..d69b529 100644 --- a/tests/k8s/test_fields.py +++ b/tests/k8s/test_fields.py @@ -8,7 +8,7 @@ from k8s import config from k8s.base import Model from k8s.fields import Field, ListField, OnceField, ReadOnlyField, RequiredField -from k8s.models.common import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ObjectMeta class ModelTest(Model): diff --git a/tests/k8s/test_ingress.py b/tests/k8s/test_ingress.py index 58e8fdf..f849ea8 100644 --- a/tests/k8s/test_ingress.py +++ b/tests/k8s/test_ingress.py @@ -5,11 +5,15 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.ingress import Ingress, IngressSpec, IngressRule, IngressBackend, HTTPIngressPath, HTTPIngressRuleValue +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.apis.extensions.v1beta1 import Ingress, IngressBackend, HTTPIngressPath, \ + HTTPIngressRuleValue, IngressRule, IngressSpec NAME = "my-name" NAMESPACE = "my-namespace" +POST_URI = Ingress._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = Ingress._meta.update_url.format(name=NAME, namespace=NAMESPACE) +GET_URI = Ingress._meta.get_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") @@ -29,7 +33,7 @@ def test_created_if_not_exists(self, post, api_get): ingress.save() assert not ingress._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_updated_if_exists(self, get, put): mock_response = _create_mock_response() @@ -43,7 +47,7 @@ def test_updated_if_exists(self, get, put): put.return_value.json.return_value = call_params from_api.save() - pytest.helpers.assert_any_call(put, _uri(NAMESPACE, NAME), call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def _create_mock_response(): @@ -60,7 +64,7 @@ def _create_mock_response(): "name": NAME, "namespace": NAMESPACE, "resourceVersion": "96758807", - "selfLink": _uri(NAMESPACE, NAME), + "selfLink": GET_URI, "uid": "d8f1ba26-b182-11e6-a364-fa163ea2a9c4" }, "spec": { @@ -98,7 +102,3 @@ def _create_default_ingress(): ingress_spec = IngressSpec(rules=[ingress_rule]) ingress = Ingress(metadata=object_meta, spec=ingress_spec) return ingress - - -def _uri(namespace, name=""): - return "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}".format(name=name, namespace=namespace) diff --git a/tests/k8s/test_job.py b/tests/k8s/test_job.py index d2a951a..19d8800 100644 --- a/tests/k8s/test_job.py +++ b/tests/k8s/test_job.py @@ -5,12 +5,13 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.job import Job, JobSpec -from k8s.models.pod import Container, LocalObjectReference, PodTemplateSpec, PodSpec +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import Container, LocalObjectReference, PodSpec, PodTemplateSpec +from k8s.models.v1_6.kubernetes.apis.batch.v1 import Job, JobSpec NAME = "my-name" NAMESPACE = "my-namespace" +POST_URI = Job._meta.create_url.format(namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") @@ -30,7 +31,7 @@ def test_created_if_not_exists(self, post, api_get): job.save() assert not job._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def _create_default_job(): @@ -92,7 +93,3 @@ def _create_mock_response(): } } return mock_response - - -def _uri(namespace, name=""): - return "/apis/batch/v1/namespaces/{namespace}/jobs".format(name=name, namespace=namespace) diff --git a/tests/k8s/test_model.py b/tests/k8s/test_model.py index 263ab6c..7ae9e45 100644 --- a/tests/k8s/test_model.py +++ b/tests/k8s/test_model.py @@ -10,12 +10,20 @@ from k8s.base import Model from k8s.client import Client from k8s.fields import Field, ListField, OnceField, ReadOnlyField -from k8s.models.common import ObjectMeta +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta class ModelTest(Model): class Meta: - pass + create_url = "/apis/tests/v1/namespaces/{namespace}/model_test" + delete_url = "/apis/tests/v1/namespaces/{namespace}/model_test/{name}" + get_url = "/apis/tests/v1/namespaces/{namespace}/model_test/{name}" + list_all_url = "/apis/tests/v1/model_test" + list_ns_url = "/apis/tests/v1/namespaces/{namespace}/model_test" + update_url = "/apis/tests/v1/namespaces/{namespace}/model_test/{name}" + watch_url = "/apis/tests/v1/watch/namespaces/{namespace}/model_test/{name}" + watchlist_all_url = "/apis/tests/v1/watch/model_test" + watchlist_ns_url = "/apis/tests/v1/watch/namespaces/{namespace}/model_test" metadata = Field(ObjectMeta) field = Field(int) @@ -94,6 +102,7 @@ def test_annotations_replace(self, mock_response): assert instance.metadata.annotations["will_overwrite"] == "that" assert "must_discard" not in instance.metadata.annotations + @pytest.mark.skip("Needs a generator to generate ReadOnlyFields when needed") def test_spec_merge(self, mock_response): mock_response.json.return_value = { "metadata": { diff --git a/tests/k8s/test_pod.py b/tests/k8s/test_pod.py index 8c1d1a0..03bee71 100644 --- a/tests/k8s/test_pod.py +++ b/tests/k8s/test_pod.py @@ -6,13 +6,15 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.pod import Pod, ContainerPort, Container, LocalObjectReference, PodSpec, Volume, VolumeMount, \ - SecretVolumeSource +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import Pod, ContainerPort, VolumeMount, Volume, SecretVolumeSource, Container, \ + LocalObjectReference, PodSpec NAME = "my-name" NAMESPACE = "my-namespace" -POD_URI = Pod._meta.url_template.format(name="", namespace=NAMESPACE) +POST_URI = Pod._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = Pod._meta.update_url.format(name=NAME, namespace=NAMESPACE) +DELETE_URI = Pod._meta.delete_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("logger", "k8s_config") @@ -31,7 +33,7 @@ def test_pod_created_if_not_exists(self, post, api_get): assert pod._new pod.save() assert not pod._new - pytest.helpers.assert_any_call(post, POD_URI, call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_get_or_create_pod_not_new(self, put, get): mock_response = mock.Mock() @@ -109,13 +111,13 @@ def test_get_or_create_pod_not_new(self, put, get): put.return_value.json.return_value = call_params pod.save() - pytest.helpers.assert_any_call(put, POD_URI + NAME, call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def test_pod_deleted(self, delete): Pod.delete(NAME, NAMESPACE) # call delete with service_name - pytest.helpers.assert_any_call(delete, POD_URI + NAME) + pytest.helpers.assert_any_call(delete, DELETE_URI) def _create_pod(): diff --git a/tests/k8s/test_resourcequota.py b/tests/k8s/test_resourcequota.py index 5e89cc6..4b04bc6 100644 --- a/tests/k8s/test_resourcequota.py +++ b/tests/k8s/test_resourcequota.py @@ -5,11 +5,16 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.resourcequota import ResourceQuota, ResourceQuotaSpec, NotBestEffort, BestEffort +from k8s.models.enums import ResourceQuotaScope +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ResourceQuota, ResourceQuotaSpec NAME = "my-name" NAMESPACE = "my-namespace" +POST_URI = ResourceQuota._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = ResourceQuota._meta.update_url.format(name=NAME, namespace=NAMESPACE) +DELETE_URI = ResourceQuota._meta.delete_url.format(name=NAME, namespace=NAMESPACE) +GET_URI = ResourceQuota._meta.get_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") @@ -24,7 +29,7 @@ def test_created_if_not_exists(self, post, api_get): resourcequota.save() assert not resourcequota._new - pytest.helpers.assert_any_call(post, _uri(NAMESPACE), call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_updated_if_exists(self, get, put): mock_response = _create_mock_response() @@ -36,16 +41,16 @@ def test_updated_if_exists(self, get, put): assert from_api.spec == resourcequota.spec assert from_api.status == resourcequota.status - from_api.spec = ResourceQuotaSpec(hard={'pods': "10"}, scopes=[BestEffort]) + from_api.spec = ResourceQuotaSpec(hard={'pods': "10"}, scopes=[ResourceQuotaScope.BestEffort]) call_params = from_api.as_dict() put.return_value.json.return_value = call_params from_api.save() - pytest.helpers.assert_any_call(put, _uri(NAMESPACE, NAME), call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def test_deleted(self, delete): ResourceQuota.delete(NAME, namespace=NAMESPACE) - pytest.helpers.assert_any_call(delete, _uri(NAMESPACE, NAME)) + pytest.helpers.assert_any_call(delete, DELETE_URI) def _create_mock_response(): @@ -62,7 +67,7 @@ def _create_mock_response(): "name": NAME, "namespace": NAMESPACE, "resourceVersion": "42", - "selfLink": _uri(NAMESPACE, NAME), + "selfLink": GET_URI, "uid": "d8f1ba26-b182-11e6-a364-fa163ea2a9c4" }, "spec": { @@ -70,7 +75,7 @@ def _create_mock_response(): "pods": "0", }, "scopes": [ - NotBestEffort, + ResourceQuotaScope.NotBestEffort, ], }, } @@ -79,10 +84,6 @@ def _create_mock_response(): def _create_default_resourcequota(): objectmeta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"test": "true"}) - resourcequotaspec = ResourceQuotaSpec(hard={"pods": "0"}, scopes=[NotBestEffort]) + resourcequotaspec = ResourceQuotaSpec(hard={"pods": "0"}, scopes=[ResourceQuotaScope.NotBestEffort]) resourcequota = ResourceQuota(metadata=objectmeta, spec=resourcequotaspec) return resourcequota - - -def _uri(namespace, name=""): - return "/api/v1/namespaces/{namespace}/resourcequotas".format(name=name, namespace=namespace) diff --git a/tests/k8s/test_service.py b/tests/k8s/test_service.py index 10f1bb6..6c14c30 100644 --- a/tests/k8s/test_service.py +++ b/tests/k8s/test_service.py @@ -5,30 +5,33 @@ import pytest from k8s.client import NotFound -from k8s.models.common import ObjectMeta -from k8s.models.service import Service, ServicePort, ServiceSpec +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +from k8s.models.v1_6.kubernetes.api.v1 import ServicePort, ServiceSpec, Service -SERVICE_NAMESPACE = 'my-namespace' -SERVICE_NAME = 'my_name' -SERVICES_URI = '/api/v1/namespaces/' + SERVICE_NAMESPACE + '/services/' +NAMESPACE = 'my-namespace' +NAME = 'my_name' +POST_URI = Service._meta.create_url.format(namespace=NAMESPACE) +PUT_URI = Service._meta.update_url.format(name=NAME, namespace=NAMESPACE) +DELETE_URI = Service._meta.delete_url.format(name=NAME, namespace=NAMESPACE) +GET_URI = Service._meta.get_url.format(name=NAME, namespace=NAMESPACE) @pytest.mark.usefixtures("k8s_config") class TestService(object): def test_create_blank_service(self): svc = create_default_service() - assert svc.metadata.name == SERVICE_NAME - assert svc.as_dict()[u"metadata"][u"name"] == SERVICE_NAME + assert svc.metadata.name == NAME + assert svc.as_dict()[u"metadata"][u"name"] == NAME def test_create_blank_object_meta(self): - meta = ObjectMeta(name=SERVICE_NAME, namespace=SERVICE_NAMESPACE, labels={"label": "value"}) + meta = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"label": "value"}) assert not hasattr(meta, "_name") - assert meta.name == SERVICE_NAME - assert meta.namespace == SERVICE_NAMESPACE + assert meta.name == NAME + assert meta.namespace == NAMESPACE assert meta.labels == {"label": "value"} assert meta.as_dict() == { - "name": SERVICE_NAME, - "namespace": SERVICE_NAMESPACE, + "name": NAME, + "namespace": NAMESPACE, "finalizers": [], "labels": { "label": "value" @@ -45,7 +48,7 @@ def test_service_created_if_not_exists(self, post, api_get): assert service._new service.save() assert not service._new - pytest.helpers.assert_any_call(post, SERVICES_URI, call_params) + pytest.helpers.assert_any_call(post, POST_URI, call_params) def test_get_or_create_service_not_new(self, put, get): service = create_default_service() @@ -53,9 +56,9 @@ def test_get_or_create_service_not_new(self, put, get): mock_response = mock.Mock() mock_response.json.return_value = { "kind": "Service", "apiVersion": "v1", "metadata": { - "name": SERVICE_NAME, - "namespace": SERVICE_NAMESPACE, - "selfLink": "/api/v1/namespaces/" + SERVICE_NAMESPACE + "/services/my-name", + "name": NAME, + "namespace": NAMESPACE, + "selfLink": GET_URI, "uid": "cc562581-cbf5-11e5-b6ef-247703d2e388", "resourceVersion": "817", "creationTimestamp": "2016-02-05T10:47:06Z", @@ -77,7 +80,7 @@ def test_get_or_create_service_not_new(self, put, get): } get.return_value = mock_response - metadata = ObjectMeta(name=SERVICE_NAME, namespace=SERVICE_NAMESPACE, labels={"app": "test"}) + metadata = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"app": "test"}) port = ServicePort(name="my-port", port=80, targetPort="name") spec = ServiceSpec(ports=[port]) @@ -89,13 +92,13 @@ def test_get_or_create_service_not_new(self, put, get): put.return_value.json.return_value = call_params from_api.save() - pytest.helpers.assert_any_call(put, SERVICES_URI + SERVICE_NAME, call_params) + pytest.helpers.assert_any_call(put, PUT_URI, call_params) def test_service_deleted(self, delete): - Service.delete(SERVICE_NAME, SERVICE_NAMESPACE) + Service.delete(NAME, NAMESPACE) # call delete with service_name - pytest.helpers.assert_any_call(delete, (SERVICES_URI + SERVICE_NAME)) + pytest.helpers.assert_any_call(delete, DELETE_URI) def test_list_services(self, get): service_list = { @@ -171,7 +174,7 @@ def test_list_services(self, get): def create_default_service(): - metadata = ObjectMeta(name=SERVICE_NAME, namespace=SERVICE_NAMESPACE, labels={"app": "test"}) + metadata = ObjectMeta(name=NAME, namespace=NAMESPACE, labels={"app": "test"}) port = ServicePort(name="my-port", port=80, targetPort="name") spec = ServiceSpec(ports=[port]) return Service(metadata=metadata, spec=spec) diff --git a/tests/k8s/test_watcher.py b/tests/k8s/test_watcher.py index 9f84528..bd4c834 100644 --- a/tests/k8s/test_watcher.py +++ b/tests/k8s/test_watcher.py @@ -6,7 +6,7 @@ import six from k8s.base import Model, Field, WatchEvent -from k8s.models.common import ObjectMeta +from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta from k8s.watcher import Watcher # Just to make things shorter From a8697495e6209901792cca20147fcd9ce14b8634 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 14:04:26 +0100 Subject: [PATCH 15/25] Generate required and read-only fields --- bin/generator.py | 16 +- bin/model.jinja2 | 9 +- k8s/fields.py | 11 +- k8s/models/v1_6/apimachinery/apis/meta/v1.py | 206 +- k8s/models/v1_6/apimachinery/runtime.py | 12 +- k8s/models/v1_6/apimachinery/version.py | 28 +- k8s/models/v1_6/kubernetes/api/v1.py | 2032 ++++++++-------- .../v1_6/kubernetes/apis/apps/v1beta1.py | 188 +- .../v1_6/kubernetes/apis/authentication/v1.py | 12 +- .../kubernetes/apis/authentication/v1beta1.py | 28 +- .../v1_6/kubernetes/apis/authorization/v1.py | 98 +- .../kubernetes/apis/authorization/v1beta1.py | 78 +- .../v1_6/kubernetes/apis/autoscaling/v1.py | 82 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 150 +- k8s/models/v1_6/kubernetes/apis/batch/v1.py | 40 +- .../v1_6/kubernetes/apis/batch/v2alpha1.py | 14 +- .../kubernetes/apis/certificates/v1beta1.py | 14 +- .../kubernetes/apis/extensions/v1beta1.py | 652 ++--- .../v1_6/kubernetes/apis/policy/v1beta1.py | 46 +- .../v1_6/kubernetes/apis/rbac/v1alpha1.py | 174 +- .../v1_6/kubernetes/apis/rbac/v1beta1.py | 94 +- .../v1_6/kubernetes/apis/settings/v1alpha1.py | 8 + k8s/models/v1_6/kubernetes/apis/storage/v1.py | 12 +- .../v1_6/kubernetes/apis/storage/v1beta1.py | 12 +- k8s/models/v1_7/apimachinery/apis/meta/v1.py | 222 +- k8s/models/v1_7/apimachinery/runtime.py | 12 +- k8s/models/v1_7/apimachinery/version.py | 28 +- .../apis/apiregistration/v1beta1.py | 22 +- k8s/models/v1_7/kubernetes/api/v1.py | 2140 +++++++++-------- .../apis/admissionregistration/v1alpha1.py | 44 +- .../v1_7/kubernetes/apis/apps/v1beta1.py | 220 +- .../v1_7/kubernetes/apis/authentication/v1.py | 12 +- .../kubernetes/apis/authentication/v1beta1.py | 12 +- .../v1_7/kubernetes/apis/authorization/v1.py | 98 +- .../kubernetes/apis/authorization/v1beta1.py | 64 +- .../v1_7/kubernetes/apis/autoscaling/v1.py | 62 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 132 +- k8s/models/v1_7/kubernetes/apis/batch/v1.py | 40 +- .../v1_7/kubernetes/apis/batch/v2alpha1.py | 28 +- .../kubernetes/apis/certificates/v1beta1.py | 44 +- .../kubernetes/apis/extensions/v1beta1.py | 656 ++--- .../v1_7/kubernetes/apis/networking/v1.py | 26 +- .../v1_7/kubernetes/apis/policy/v1beta1.py | 52 +- .../v1_7/kubernetes/apis/rbac/v1alpha1.py | 174 +- .../v1_7/kubernetes/apis/rbac/v1beta1.py | 94 +- .../v1_7/kubernetes/apis/settings/v1alpha1.py | 8 + k8s/models/v1_7/kubernetes/apis/storage/v1.py | 12 +- .../v1_7/kubernetes/apis/storage/v1beta1.py | 12 +- tests/k8s/test_fields.py | 10 +- tests/k8s/test_model.py | 9 +- 50 files changed, 4302 insertions(+), 3947 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 55e74d1..efb7e90 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -137,8 +137,9 @@ def _parse_models(self): x = {k.lower(): v for k, v in x.items()} gvks.append(GVK(**x)) fields = [] + required_fields = item.get("required", []) for field_name, property in item.get("properties", {}).items(): - fields.append(self._parse_field(field_name, property)) + fields.append(self._parse_field(field_name, property, required_fields)) if not fields: print("Model {}.{}.{} has no fields, skipping".format(package_ref, module_name, def_name)) continue @@ -153,17 +154,22 @@ def _parse_models(self): len(self._models), len(self._gvk_lookup))) - def _parse_field(self, field_name, property): - if keyword.iskeyword(field_name): - field_name = "_{}".format(field_name) + def _parse_field(self, field_name, property, required_fields): field_type = property.get("type") field_ref = property.get("$ref") field_cls = "Field" + description = property.get("description", "") if field_type == "array" and "items" in property: field_type = property["items"].get("type") field_ref = property["items"].get("$ref") field_cls = "ListField" - field = Field(field_name, property.get("description", ""), field_type, field_ref, field_cls, None) + elif ". Read-only." in description: + field_cls = "ReadOnlyField" + elif field_name in required_fields: + field_cls = "RequiredField" + if keyword.iskeyword(field_name): + field_name = "_{}".format(field_name) + field = Field(field_name, description, field_type, field_ref, field_cls, None) return field def get_package(self, package_ref): diff --git a/bin/model.jinja2 b/bin/model.jinja2 index d2d5803..79702fb 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -2,11 +2,18 @@ # -*- coding: utf-8 from __future__ import absolute_import +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + import six import datetime from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField {% for import in module.imports %} from k8s.models.{{ version }}.{{ import.module.ref }} import {{ import.names|join(", ") }} {% endfor %} diff --git a/k8s/fields.py b/k8s/fields.py index 653559f..68a331b 100644 --- a/k8s/fields.py +++ b/k8s/fields.py @@ -81,7 +81,8 @@ def _from_dict(self, value): return self.default_value try: return self.type.from_dict(value) - except AttributeError: + except AttributeError as e: + print(e) if isinstance(value, self.type) or (self.alt_type and isinstance(value, self.alt_type)): return value if self.type is datetime: @@ -105,14 +106,6 @@ def __set__(self, instance, value): pass -class OnceField(Field): - """OnceField can only be set on new instances, and is immutable after creation on the server""" - - def __set__(self, instance, value): - if instance._new: - super(OnceField, self).__set__(instance, value) - - class ListField(Field): """ListField is a list (array) of a single type on a model""" diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py index 3d12a7c..4ca9ebd 100644 --- a/k8s/models/v1_6/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -7,67 +7,36 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.apimachinery.runtime import RawExtension -class ListMeta(Model): - """ - ListMeta describes metadata that synthetic resources must have, including lists - and various status objects. A resource may have only one of {ObjectMeta, - ListMeta}. - """ - - resourceVersion = Field(six.text_type) - selfLink = Field(six.text_type) - - -class WatchEvent(Model): - """ - Event represents a single event to a watched resource. - """ - - object = Field(RawExtension) - type = Field(six.text_type) - - -class StatusCause(Model): - """ - StatusCause provides more information about an api.Status failure, including - cases when multiple errors are encountered. - """ - - field = Field(six.text_type) - message = Field(six.text_type) - reason = Field(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### -class StatusDetails(Model): +class ServerAddressByClientCIDR(Model): """ - StatusDetails is a set of additional properties that MAY be set by the server - to provide additional information about a response. The Reason field of a - Status object defines what attributes will be set. Clients must ignore fields - that do not match the defined type of each attribute, and should assume that - any attribute may be empty, invalid, or under defined. + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. """ - causes = ListField(StatusCause) - group = Field(six.text_type) - name = Field(six.text_type) - retryAfterSeconds = Field(int) + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) -class Status(Model): +class APIVersions(Model): """ - Status is a return value for calls that don't return other objects. + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. """ - code = Field(int) - details = Field(StatusDetails) - message = Field(six.text_type) - metadata = Field(ListMeta) - reason = Field(six.text_type) - status = Field(six.text_type) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) class GroupVersionForDiscovery(Model): @@ -76,18 +45,8 @@ class GroupVersionForDiscovery(Model): is made a struct to keep extensibility. """ - groupVersion = Field(six.text_type) - version = Field(six.text_type) - - -class ServerAddressByClientCIDR(Model): - """ - ServerAddressByClientCIDR helps the client to determine the server address that - they should use, depending on the clientCIDR that they match. - """ - - clientCIDR = Field(six.text_type) - serverAddress = Field(six.text_type) + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) class APIGroup(Model): @@ -96,7 +55,7 @@ class APIGroup(Model): of a group. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) preferredVersion = Field(GroupVersionForDiscovery) serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) versions = ListField(GroupVersionForDiscovery) @@ -111,14 +70,26 @@ class APIGroupList(Model): groups = ListField(APIGroup) -class APIVersions(Model): +class LabelSelectorRequirement(Model): """ - APIVersions lists the versions that are available, to allow clients to discover - the API at /api, which is the root path of the legacy v1 API. + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) - versions = ListField(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) class APIResource(Model): @@ -126,8 +97,8 @@ class APIResource(Model): APIResource specifies the name of a resource and whether it is namespaced. """ - name = Field(six.text_type) - namespaced = Field(bool) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) shortNames = ListField(six.text_type) verbs = ListField(six.text_type) @@ -139,28 +110,28 @@ class APIResourceList(Model): namespaced. """ - groupVersion = Field(six.text_type) + groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) -class Preconditions(Model): +class ListMeta(Model): """ - Preconditions must be fulfilled before an operation (update, delete, etc.) is - carried out. + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. """ - uid = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) -class DeleteOptions(Model): +class WatchEvent(Model): """ - DeleteOptions may be provided when deleting an API object. + Event represents a single event to a watched resource. """ - gracePeriodSeconds = Field(int) - orphanDependents = Field(bool) - preconditions = Field(Preconditions) - propagationPolicy = Field(six.text_type) + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) class OwnerReference(Model): @@ -172,8 +143,8 @@ class OwnerReference(Model): blockOwnerDeletion = Field(bool) controller = Field(bool) - name = Field(six.text_type) - uid = Field(six.text_type) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) class ObjectMeta(Model): @@ -184,39 +155,76 @@ class ObjectMeta(Model): annotations = Field(dict) clusterName = Field(six.text_type) - creationTimestamp = Field(datetime.datetime) - deletionGracePeriodSeconds = Field(int) - deletionTimestamp = Field(datetime.datetime) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) finalizers = ListField(six.text_type) generateName = Field(six.text_type) - generation = Field(int) + generation = ReadOnlyField(int) labels = Field(dict) name = Field(six.text_type) namespace = Field(six.text_type) ownerReferences = ListField(OwnerReference) - resourceVersion = Field(six.text_type) - selfLink = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + uid = Field(six.text_type) -class LabelSelectorRequirement(Model): +class DeleteOptions(Model): """ - A label selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + DeleteOptions may be provided when deleting an API object. """ - key = Field(six.text_type) - operator = Field(six.text_type) - values = ListField(six.text_type) + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) -class LabelSelector(Model): +class StatusCause(Model): """ - A label selector is a label query over a set of resources. The result of - matchLabels and matchExpressions are ANDed. An empty label selector matches all - objects. A null label selector matches no objects. + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. """ - matchExpressions = ListField(LabelSelectorRequirement) - matchLabels = Field(dict) + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) diff --git a/k8s/models/v1_6/apimachinery/runtime.py b/k8s/models/v1_6/apimachinery/runtime.py index 5110035..e483edb 100644 --- a/k8s/models/v1_6/apimachinery/runtime.py +++ b/k8s/models/v1_6/apimachinery/runtime.py @@ -5,7 +5,15 @@ import six from k8s.base import Model -from k8s.fields import Field +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class RawExtension(Model): @@ -54,5 +62,5 @@ class RawExtension(Model): runtime.Unknown object will be created and stored.) """ - Raw = Field(six.text_type) + Raw = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/apimachinery/version.py b/k8s/models/v1_6/apimachinery/version.py index c3457cb..522b6b7 100644 --- a/k8s/models/v1_6/apimachinery/version.py +++ b/k8s/models/v1_6/apimachinery/version.py @@ -5,7 +5,15 @@ import six from k8s.base import Model -from k8s.fields import Field +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class Info(Model): @@ -14,13 +22,13 @@ class Info(Model): information. """ - buildDate = Field(six.text_type) - compiler = Field(six.text_type) - gitCommit = Field(six.text_type) - gitTreeState = Field(six.text_type) - gitVersion = Field(six.text_type) - goVersion = Field(six.text_type) - major = Field(six.text_type) - minor = Field(six.text_type) - platform = Field(six.text_type) + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py index 9018d40..eeb1434 100644 --- a/k8s/models/v1_6/kubernetes/api/v1.py +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -7,97 +7,52 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta -class ContainerStateTerminated(Model): - """ - ContainerStateTerminated is a terminated state of a container. - """ - - containerID = Field(six.text_type) - exitCode = Field(int) - finishedAt = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - signal = Field(int) - startedAt = Field(datetime.datetime) - - -class HTTPHeader(Model): - """ - HTTPHeader describes a custom header to be used in HTTP probes - """ - - name = Field(six.text_type) - value = Field(six.text_type) - - -class HTTPGetAction(Model): - """ - HTTPGetAction describes an action based on HTTP Get requests. - """ - - host = Field(six.text_type) - httpHeaders = ListField(HTTPHeader) - path = Field(six.text_type) - port = Field(six.text_type, alt_type=int) - scheme = Field(six.text_type) - +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### -class PodAffinityTerm(Model): - """ - Defines a set of pods (namely those matching the labelSelector relative to the - given namespace(s)) that this pod should be co-located (affinity) or not co- - located (anti-affinity) with, where co-located is defined as running on a node - whose value of the label with key tches that of any node on which - a pod of the set of pods is running - """ - - labelSelector = Field(LabelSelector) - namespaces = ListField(six.text_type) - topologyKey = Field(six.text_type) - - -class WeightedPodAffinityTerm(Model): - """ - The weights of all of the matched WeightedPodAffinityTerm fields are added per- - node to find the most preferred node(s) - """ - - podAffinityTerm = Field(PodAffinityTerm) - weight = Field(int) - -class PodAffinity(Model): +class ISCSIVolumeSource(Model): """ - Pod affinity is a group of inter pod affinity scheduling rules. + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + fsType = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + targetPortal = RequiredField(six.text_type) -class PodAntiAffinity(Model): +class FCVolumeSource(Model): """ - Pod anti affinity is a group of inter pod anti affinity scheduling rules. + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + fsType = Field(six.text_type) + lun = RequiredField(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) -class GitRepoVolumeSource(Model): +class ObjectFieldSelector(Model): """ - Represents a volume that is populated with the contents of a git repository. - Git repo volumes do not support ownership management. Git repo volumes support - SELinux relabeling. + ObjectFieldSelector selects an APIVersioned field of an object. """ - directory = Field(six.text_type) - repository = Field(six.text_type) - revision = Field(six.text_type) + fieldPath = RequiredField(six.text_type) class LoadBalancerIngress(Model): @@ -126,343 +81,338 @@ class ServiceStatus(Model): loadBalancer = Field(LoadBalancerStatus) -class PersistentVolumeClaimVolumeSource(Model): +class HTTPHeader(Model): """ - PersistentVolumeClaimVolumeSource references the user's PVC in the same - namespace. This volume finds the bound PV and mounts that volume for the pod. A - PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another - type of volume that is owned by someone else (the system). + HTTPHeader describes a custom header to be used in HTTP probes """ - claimName = Field(six.text_type) - readOnly = Field(bool) + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) -class DaemonEndpoint(Model): +class HTTPGetAction(Model): """ - DaemonEndpoint contains information about a single Daemon endpoint. + HTTPGetAction describes an action based on HTTP Get requests. """ - Port = Field(int) + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) -class NodeDaemonEndpoints(Model): +class ContainerStateWaiting(Model): """ - NodeDaemonEndpoints lists ports opened by daemons running on the Node. + ContainerStateWaiting is a waiting state of a container. """ - kubeletEndpoint = Field(DaemonEndpoint) + message = Field(six.text_type) + reason = Field(six.text_type) -class ResourceQuotaSpec(Model): +class QuobyteVolumeSource(Model): """ - ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. """ - hard = Field(dict) - scopes = ListField(six.text_type) + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) -class ContainerStateRunning(Model): +class LocalObjectReference(Model): """ - ContainerStateRunning is a running state of a container. + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. """ - startedAt = Field(datetime.datetime) + name = Field(six.text_type) -class AzureDiskVolumeSource(Model): +class ScaleIOVolumeSource(Model): """ - AzureDisk represents an Azure Data Disk mount on the host and bind mount to the - pod. + ScaleIOVolumeSource represents a persistent ScaleIO volume """ - cachingMode = Field(six.text_type) - diskName = Field(six.text_type) - diskURI = Field(six.text_type) fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) -class FCVolumeSource(Model): +class CephFSVolumeSource(Model): """ - Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as - read/write once. Fibre Channel volumes support ownership management and SELinux - relabeling. + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. """ - fsType = Field(six.text_type) - lun = Field(int) + monitors = ListField(six.text_type) + path = Field(six.text_type) readOnly = Field(bool) - targetWWNs = ListField(six.text_type) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class CinderVolumeSource(Model): +class FlexVolumeSource(Model): """ - Represents a cinder volume resource in Openstack. A Cinder volume must exist - before mounting to a container. The volume must also be in the same region as - the kubelet. Cinder volumes support ownership management and SELinux - relabeling. + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. """ + driver = RequiredField(six.text_type) fsType = Field(six.text_type) + options = Field(dict) readOnly = Field(bool) - volumeID = Field(six.text_type) + secretRef = Field(LocalObjectReference) -class ContainerPort(Model): +class RBDVolumeSource(Model): """ - ContainerPort represents a network port in a single container. + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. """ - containerPort = Field(int) - hostIP = Field(six.text_type) - hostPort = Field(int) - name = Field(six.text_type) - protocol = Field(six.text_type) + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class NodeSelectorRequirement(Model): +class Taint(Model): """ - A node selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. """ - key = Field(six.text_type) - operator = Field(six.text_type) - values = ListField(six.text_type) + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) -class NodeSelectorTerm(Model): +class NodeSpec(Model): """ - A null or empty node selector term matches no objects. + NodeSpec describes the attributes that a node is created with. """ - matchExpressions = ListField(NodeSelectorRequirement) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) -class PreferredSchedulingTerm(Model): +class AzureFileVolumeSource(Model): """ - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. - is also a no-op). + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. """ - preference = Field(NodeSelectorTerm) - weight = Field(int) + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) -class NodeSelector(Model): +class PortworxVolumeSource(Model): """ - A node selector represents the union of the results of one or more label - queries over a set of nodes; that is, it represents the OR of the selectors - represented by the node selector terms. + PortworxVolumeSource represents a Portworx volume resource. """ - nodeSelectorTerms = ListField(NodeSelectorTerm) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class NodeAffinity(Model): +class ResourceQuotaStatus(Model): """ - Node affinity is a group of node affinity scheduling rules. + ResourceQuotaStatus defines the enforced hard limits and observed use. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) - requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + hard = Field(dict) + used = Field(dict) -class Affinity(Model): +class Capabilities(Model): """ - Affinity is a group of affinity scheduling rules. + Adds and removes POSIX capabilities from running containers. """ - nodeAffinity = Field(NodeAffinity) - podAffinity = Field(PodAffinity) - podAntiAffinity = Field(PodAntiAffinity) + add = ListField(six.text_type) + drop = ListField(six.text_type) -class VsphereVirtualDiskVolumeSource(Model): +class ContainerImage(Model): """ - Represents a vSphere volume resource. + Describe a container image """ - fsType = Field(six.text_type) - volumePath = Field(six.text_type) + names = ListField(six.text_type) + sizeBytes = Field(int) -class NamespaceStatus(Model): +class AttachedVolume(Model): """ - NamespaceStatus is information about the current status of a Namespace. + AttachedVolume describes a volume attached to a node """ - phase = Field(six.text_type) + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) -class ExecAction(Model): +class EndpointPort(Model): """ - ExecAction describes a 'run in container' action. + EndpointPort is a tuple that describes a single port. """ - command = ListField(six.text_type) + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) -class ReplicationControllerCondition(Model): +class PersistentVolumeStatus(Model): """ - ReplicationControllerCondition describes the state of a replication controller - at a certain point. + PersistentVolumeStatus is the current status of a persistent volume. """ - lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) + phase = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) -class ReplicationControllerStatus(Model): - """ - ReplicationControllerStatus represents the current status of a replication - controller. - """ - - availableReplicas = Field(int) - conditions = ListField(ReplicationControllerCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = Field(int) - - -class NodeAddress(Model): - """ - NodeAddress contains information for the node's address. - """ - - address = Field(six.text_type) - type = Field(six.text_type) - - -class PortworxVolumeSource(Model): +class ResourceQuotaSpec(Model): """ - PortworxVolumeSource represents a Portworx volume resource. + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. """ - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = Field(six.text_type) + hard = Field(dict) + scopes = ListField(six.text_type) -class NodeCondition(Model): +class ResourceQuota(Model): """ - NodeCondition contains condition information for a node. + ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") - lastHeartbeatTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) -class ResourceRequirements(Model): +class ResourceQuotaList(Model): """ - ResourceRequirements describes the compute resource requirements. + ResourceQuotaList is a list of ResourceQuota items. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") - limits = Field(dict) - requests = Field(dict) + items = ListField(ResourceQuota) + metadata = Field(ListMeta) -class PersistentVolumeClaimSpec(Model): +class VsphereVirtualDiskVolumeSource(Model): """ - PersistentVolumeClaimSpec describes the common attributes of storage devices - and allows a Source for provider-specific attributes + Represents a vSphere volume resource. """ - accessModes = ListField(six.text_type) - resources = Field(ResourceRequirements) - selector = Field(LabelSelector) - storageClassName = Field(six.text_type) - volumeName = Field(six.text_type) + fsType = Field(six.text_type) + volumePath = RequiredField(six.text_type) -class LocalObjectReference(Model): +class ComponentCondition(Model): """ - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + Information about the condition of a component. """ - name = Field(six.text_type) + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class FlexVolumeSource(Model): +class ComponentStatus(Model): """ - FlexVolume represents a generic volume resource that is provisioned/attached - using an exec based plugin. This is an alpha feature and may change in future. + ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") - driver = Field(six.text_type) - fsType = Field(six.text_type) - options = Field(dict) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) -class ScaleIOVolumeSource(Model): +class ComponentStatusList(Model): """ - ScaleIOVolumeSource represents a persistent ScaleIO volume + Status of all the conditions for the component as a list of ComponentStatus + objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") - fsType = Field(six.text_type) - gateway = Field(six.text_type) - protectionDomain = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - sslEnabled = Field(bool) - storageMode = Field(six.text_type) - storagePool = Field(six.text_type) - system = Field(six.text_type) - volumeName = Field(six.text_type) + items = ListField(ComponentStatus) + metadata = Field(ListMeta) -class RBDVolumeSource(Model): +class EmptyDirVolumeSource(Model): """ - Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD - volumes support ownership management and SELinux relabeling. + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. """ - fsType = Field(six.text_type) - image = Field(six.text_type) - keyring = Field(six.text_type) - monitors = ListField(six.text_type) - pool = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + medium = Field(six.text_type) -class CephFSVolumeSource(Model): +class ExecAction(Model): """ - Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs - volumes do not support ownership management or SELinux relabeling. + ExecAction describes a 'run in container' action. """ - monitors = ListField(six.text_type) - path = Field(six.text_type) - readOnly = Field(bool) - secretFile = Field(six.text_type) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + command = ListField(six.text_type) -class HostPathVolumeSource(Model): +class ContainerStateTerminated(Model): """ - Represents a host path mapped into a pod. Host path volumes do not support - ownership management or SELinux relabeling. + ContainerStateTerminated is a terminated state of a container. """ - path = Field(six.text_type) + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) class ObjectReference(Model): @@ -478,76 +428,17 @@ class ObjectReference(Model): uid = Field(six.text_type) -class Binding(Model): - """ - Binding ties one object to another. For example, a pod is bound to a node by a - scheduler. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Binding") - - metadata = Field(ObjectMeta) - target = Field(ObjectReference) - - -class ServiceAccount(Model): - """ - ServiceAccount binds together: * a name, understood by users, and perhaps by - peripheral systems, for an identity * a principal that can be authenticated and - authorized * a set of secrets - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - list_all_url = "/api/v1/serviceaccounts" - list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" - watchlist_all_url = "/api/v1/watch/serviceaccounts" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccount") - - automountServiceAccountToken = Field(bool) - imagePullSecrets = ListField(LocalObjectReference) - metadata = Field(ObjectMeta) - secrets = ListField(ObjectReference) - - -class ServiceAccountList(Model): - """ - ServiceAccountList is a list of ServiceAccount objects - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccountList") - - items = ListField(ServiceAccount) - metadata = Field(ListMeta) - - class EndpointAddress(Model): """ EndpointAddress is a tuple that describes single IP address. """ hostname = Field(six.text_type) - ip = Field(six.text_type) + ip = RequiredField(six.text_type) nodeName = Field(six.text_type) targetRef = Field(ObjectReference) -class EndpointPort(Model): - """ - EndpointPort is a tuple that describes a single port. - """ - - name = Field(six.text_type) - port = Field(int) - protocol = Field(six.text_type) - - class EndpointSubset(Model): """ EndpointSubset is a group of addresses with a common set of ports. The expanded @@ -618,129 +509,53 @@ class EndpointsList(Model): metadata = Field(ListMeta) -class PhotonPersistentDiskVolumeSource(Model): +class ServiceAccount(Model): """ - Represents a Photon Controller persistent disk resource. + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") - fsType = Field(six.text_type) - pdID = Field(six.text_type) + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) -class Toleration(Model): +class ServiceAccountList(Model): """ - The pod this Toleration is attached to tolerates any taint that matches the - triple using the matching operator . + ServiceAccountList is a list of ServiceAccount objects """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") - effect = Field(six.text_type) - key = Field(six.text_type) - operator = Field(six.text_type) - tolerationSeconds = Field(int) - value = Field(six.text_type) + items = ListField(ServiceAccount) + metadata = Field(ListMeta) -class SecretKeySelector(Model): +class Binding(Model): """ - SecretKeySelector selects a key of a Secret. - """ - - key = Field(six.text_type) - name = Field(six.text_type) - optional = Field(bool) - - -class ResourceFieldSelector(Model): - """ - ResourceFieldSelector represents container resources (cpu, memory) and their - output format - """ - - containerName = Field(six.text_type) - divisor = Field(six.text_type) - resource = Field(six.text_type) - - -class ContainerImage(Model): - """ - Describe a container image - """ - - names = ListField(six.text_type) - sizeBytes = Field(int) - - -class KeyToPath(Model): - """ - Maps a string key to a path within a volume. - """ - - key = Field(six.text_type) - mode = Field(int) - path = Field(six.text_type) - - -class ConfigMapVolumeSource(Model): - """ - Adapts a ConfigMap into a volume. - - The contents of the target ConfigMap's Data - field will be presented in a volume as files using the keys in the Data field - as the file names, unless the items element is populated with specific mappings - of keys to paths. ConfigMap volumes support ownership management and SELinux - relabeling. - """ - - defaultMode = Field(int) - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) - - -class ConfigMapProjection(Model): - """ - Adapts a ConfigMap into a projected volume. - - The contents of the target - ConfigMap's Data field will be presented in a projected volume as files using - the keys in the Data field as the file names, unless the items element is - populated with specific mappings of keys to paths. Note that this is identical - to a configmap volume source without the default mode. - """ - - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) - - -class SecretVolumeSource(Model): - """ - Adapts a Secret into a volume. - - The contents of the target Secret's Data field - will be presented in a volume as files using the keys in the Data field as the - file names. Secret volumes support ownership management and SELinux relabeling. - """ - - defaultMode = Field(int) - items = ListField(KeyToPath) - optional = Field(bool) - secretName = Field(six.text_type) - - -class SecretProjection(Model): - """ - Adapts a secret into a projected volume. - - The contents of the target Secret's - Data field will be presented in a projected volume as files using the keys in - the Data field as the file names. Note that this is identical to a secret - volume source without the default mode. + Binding ties one object to another. For example, a pod is bound to a node by a + scheduler. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) class TCPSocketAction(Model): @@ -748,7 +563,7 @@ class TCPSocketAction(Model): TCPSocketAction describes an action based on opening a socket """ - port = Field(six.text_type, alt_type=int) + port = RequiredField(six.text_type, alt_type=int) class Handler(Model): @@ -789,592 +604,522 @@ class Probe(Model): timeoutSeconds = Field(int) -class ContainerStateWaiting(Model): +class NamespaceStatus(Model): """ - ContainerStateWaiting is a waiting state of a container. + NamespaceStatus is information about the current status of a Namespace. """ - message = Field(six.text_type) - reason = Field(six.text_type) + phase = Field(six.text_type) -class ContainerState(Model): +class CinderVolumeSource(Model): """ - ContainerState holds a possible state of container. Only one of its members may - be specified. If none of them is specified, the default one is - ContainerStateWaiting. + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. """ - running = Field(ContainerStateRunning) - terminated = Field(ContainerStateTerminated) - waiting = Field(ContainerStateWaiting) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class ContainerStatus(Model): +class HostPathVolumeSource(Model): """ - ContainerStatus contains details for the current status of this container. + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. """ - containerID = Field(six.text_type) - image = Field(six.text_type) - imageID = Field(six.text_type) - lastState = Field(ContainerState) - name = Field(six.text_type) - ready = Field(bool) - restartCount = Field(int) - state = Field(ContainerState) + path = RequiredField(six.text_type) -class NamespaceSpec(Model): +class FlockerVolumeSource(Model): """ - NamespaceSpec describes the attributes on a Namespace. + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. """ - finalizers = ListField(six.text_type) + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) -class Namespace(Model): +class Secret(Model): """ - Namespace provides a scope for Names. Use of multiple namespaces is optional. + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. """ class Meta: - create_url = "/api/v1/namespaces" - delete_url = "/api/v1/namespaces/{name}" - get_url = "/api/v1/namespaces/{name}" - list_all_url = "/api/v1/namespaces" - update_url = "/api/v1/namespaces/{name}" - update_url = "/api/v1/namespaces/{name}/finalize" - watch_url = "/api/v1/watch/namespaces/{name}" - watchlist_all_url = "/api/v1/watch/namespaces" + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Namespace") + kind = Field(six.text_type, "Secret") + data = Field(dict) metadata = Field(ObjectMeta) - spec = Field(NamespaceSpec) - status = Field(NamespaceStatus) + stringData = Field(dict) + type = Field(six.text_type) -class NamespaceList(Model): +class SecretList(Model): """ - NamespaceList is a list of Namespaces. + SecretList is a list of Secret. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NamespaceList") + kind = Field(six.text_type, "SecretList") - items = ListField(Namespace) + items = ListField(Secret) metadata = Field(ListMeta) -class VolumeMount(Model): - """ - VolumeMount describes a mounting of a Volume within a container. - """ - - mountPath = Field(six.text_type) - name = Field(six.text_type) - readOnly = Field(bool) - subPath = Field(six.text_type) - - -class NFSVolumeSource(Model): +class LimitRangeItem(Model): """ - Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not - support ownership management or SELinux relabeling. + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. """ - path = Field(six.text_type) - readOnly = Field(bool) - server = Field(six.text_type) + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) -class EventSource(Model): +class LimitRangeSpec(Model): """ - EventSource contains information for an event. + LimitRangeSpec defines a min/max usage limit for resources that match on kind. """ - component = Field(six.text_type) - host = Field(six.text_type) + limits = ListField(LimitRangeItem) -class Event(Model): +class LimitRange(Model): """ - Event is a report of an event somewhere in the cluster. + LimitRange sets resource usage limits for each kind of resource in a Namespace. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/events" - delete_url = "/api/v1/namespaces/{namespace}/events/{name}" - get_url = "/api/v1/namespaces/{namespace}/events/{name}" - list_all_url = "/api/v1/events" - list_ns_url = "/api/v1/namespaces/{namespace}/events" - update_url = "/api/v1/namespaces/{namespace}/events/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" - watchlist_all_url = "/api/v1/watch/events" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Event") + kind = Field(six.text_type, "LimitRange") - count = Field(int) - firstTimestamp = Field(datetime.datetime) - involvedObject = Field(ObjectReference) - lastTimestamp = Field(datetime.datetime) - message = Field(six.text_type) metadata = Field(ObjectMeta) - reason = Field(six.text_type) - source = Field(EventSource) - type = Field(six.text_type) + spec = Field(LimitRangeSpec) -class EventList(Model): +class LimitRangeList(Model): """ - EventList is a list of events. + LimitRangeList is a list of LimitRange items. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EventList") + kind = Field(six.text_type, "LimitRangeList") - items = ListField(Event) + items = ListField(LimitRange) metadata = Field(ListMeta) -class ConfigMap(Model): +class SecretKeySelector(Model): """ - ConfigMap holds configuration data for pods to consume. + SecretKeySelector selects a key of a Secret. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/configmaps" - delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - list_all_url = "/api/v1/configmaps" - list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" - update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" - watchlist_all_url = "/api/v1/watch/configmaps" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMap") - data = Field(dict) - metadata = Field(ObjectMeta) + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class ConfigMapList(Model): +class GCEPersistentDiskVolumeSource(Model): """ - ConfigMapList is a resource containing a list of ConfigMap objects. + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMapList") - items = ListField(ConfigMap) - metadata = Field(ListMeta) + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) -class ConfigMapKeySelector(Model): +class NodeAddress(Model): """ - Selects a key from a ConfigMap. + NodeAddress contains information for the node's address. """ - key = Field(six.text_type) + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) name = Field(six.text_type) - optional = Field(bool) + protocol = Field(six.text_type) -class ISCSIVolumeSource(Model): +class PersistentVolumeClaimStatus(Model): """ - Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. - ISCSI volumes support ownership management and SELinux relabeling. + PersistentVolumeClaimStatus is the current status of a persistent volume claim. """ - fsType = Field(six.text_type) - iqn = Field(six.text_type) - iscsiInterface = Field(six.text_type) - lun = Field(int) - portals = ListField(six.text_type) - readOnly = Field(bool) - targetPortal = Field(six.text_type) + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) -class ResourceQuotaStatus(Model): +class EventSource(Model): """ - ResourceQuotaStatus defines the enforced hard limits and observed use. + EventSource contains information for an event. """ - hard = Field(dict) - used = Field(dict) + component = Field(six.text_type) + host = Field(six.text_type) -class ResourceQuota(Model): +class Event(Model): """ - ResourceQuota sets aggregate quota restrictions enforced per namespace + Event is a report of an event somewhere in the cluster. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/resourcequotas" - delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - list_all_url = "/api/v1/resourcequotas" - list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" - update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" - watchlist_all_url = "/api/v1/watch/resourcequotas" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ResourceQuota") + kind = Field(six.text_type, "Event") - metadata = Field(ObjectMeta) - spec = Field(ResourceQuotaSpec) - status = Field(ResourceQuotaStatus) + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) -class ResourceQuotaList(Model): +class EventList(Model): """ - ResourceQuotaList is a list of ResourceQuota items. + EventList is a list of events. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ResourceQuotaList") + kind = Field(six.text_type, "EventList") - items = ListField(ResourceQuota) + items = ListField(Event) metadata = Field(ListMeta) -class PodCondition(Model): +class NodeCondition(Model): """ - PodCondition contains details for the current condition of this pod. + NodeCondition contains condition information for a node. """ - lastProbeTime = Field(datetime.datetime) + lastHeartbeatTime = Field(datetime.datetime) lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class PodStatus(Model): +class PhotonPersistentDiskVolumeSource(Model): """ - PodStatus represents information about the status of a pod. Status may trail - the actual state of a system. + Represents a Photon Controller persistent disk resource. """ - conditions = ListField(PodCondition) - containerStatuses = ListField(ContainerStatus) - hostIP = Field(six.text_type) - initContainerStatuses = ListField(ContainerStatus) - message = Field(six.text_type) - phase = Field(six.text_type) - podIP = Field(six.text_type) - qosClass = Field(six.text_type) - reason = Field(six.text_type) - startTime = Field(datetime.datetime) + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) -class ConfigMapEnvSource(Model): +class KeyToPath(Model): """ - ConfigMapEnvSource selects a ConfigMap to populate the environment variables - with. - - The contents of the target ConfigMap's Data field will represent the - key-value pairs as environment variables. + Maps a string key to a path within a volume. """ - name = Field(six.text_type) - optional = Field(bool) + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) -class AttachedVolume(Model): +class ConfigMapProjection(Model): """ - AttachedVolume describes a volume attached to a node + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. """ - devicePath = Field(six.text_type) + items = ListField(KeyToPath) name = Field(six.text_type) + optional = Field(bool) -class QuobyteVolumeSource(Model): +class ConfigMapVolumeSource(Model): """ - Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do - not support ownership management or SELinux relabeling. + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. """ - group = Field(six.text_type) - readOnly = Field(bool) - registry = Field(six.text_type) - user = Field(six.text_type) - volume = Field(six.text_type) + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PersistentVolumeStatus(Model): +class SecretProjection(Model): """ - PersistentVolumeStatus is the current status of a persistent volume. + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. """ - message = Field(six.text_type) - phase = Field(six.text_type) - reason = Field(six.text_type) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class ComponentCondition(Model): +class SecretVolumeSource(Model): """ - Information about the condition of a component. + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. """ - error = Field(six.text_type) - message = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) -class ComponentStatus(Model): +class SecretEnvSource(Model): """ - ComponentStatus (and ComponentStatusList) holds the cluster validation info. + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. """ - class Meta: - get_url = "/api/v1/componentstatuses/{name}" - list_all_url = "/api/v1/componentstatuses" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatus") - conditions = ListField(ComponentCondition) - metadata = Field(ObjectMeta) + name = Field(six.text_type) + optional = Field(bool) -class ComponentStatusList(Model): +class VolumeMount(Model): """ - Status of all the conditions for the component as a list of ComponentStatus - objects. + VolumeMount describes a mounting of a Volume within a container. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatusList") - items = ListField(ComponentStatus) - metadata = Field(ListMeta) + mountPath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) -class PersistentVolumeClaimStatus(Model): +class AWSElasticBlockStoreVolumeSource(Model): """ - PersistentVolumeClaimStatus is the current status of a persistent volume claim. + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. """ - accessModes = ListField(six.text_type) - capacity = Field(dict) - phase = Field(six.text_type) + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class PersistentVolumeClaim(Model): +class ConfigMap(Model): """ - PersistentVolumeClaim is a user's request for and claim to a persistent volume + ConfigMap holds configuration data for pods to consume. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - list_all_url = "/api/v1/persistentvolumeclaims" - list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaim") - - metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeClaimSpec) - status = Field(PersistentVolumeClaimStatus) - - -class PersistentVolumeClaimList(Model): - """ - PersistentVolumeClaimList is a list of PersistentVolumeClaim items. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaimList") - - items = ListField(PersistentVolumeClaim) - metadata = Field(ListMeta) - - -class Secret(Model): - """ - Secret holds secret data of a certain type. The total bytes of the values in - the Data field must be less than MaxSecretSize bytes. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/secrets" - delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - list_all_url = "/api/v1/secrets" - list_ns_url = "/api/v1/namespaces/{namespace}/secrets" - update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" - watchlist_all_url = "/api/v1/watch/secrets" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Secret") + kind = Field(six.text_type, "ConfigMap") data = Field(dict) metadata = Field(ObjectMeta) - stringData = Field(dict) - type = Field(six.text_type) -class SecretList(Model): +class ConfigMapList(Model): """ - SecretList is a list of Secret. + ConfigMapList is a resource containing a list of ConfigMap objects. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "SecretList") + kind = Field(six.text_type, "ConfigMapList") - items = ListField(Secret) + items = ListField(ConfigMap) metadata = Field(ListMeta) -class ObjectFieldSelector(Model): - """ - ObjectFieldSelector selects an APIVersioned field of an object. - """ - - fieldPath = Field(six.text_type) - - -class DownwardAPIVolumeFile(Model): - """ - DownwardAPIVolumeFile represents information to create the file containing the - pod field - """ - - fieldRef = Field(ObjectFieldSelector) - mode = Field(int) - path = Field(six.text_type) - resourceFieldRef = Field(ResourceFieldSelector) - - -class DownwardAPIProjection(Model): - """ - Represents downward API info for projecting into a projected volume. Note that - this is identical to a downwardAPI volume source without the default mode. - """ - - items = ListField(DownwardAPIVolumeFile) - - -class VolumeProjection(Model): - """ - Projection that may be projected along with other supported volume types - """ - - configMap = Field(ConfigMapProjection) - downwardAPI = Field(DownwardAPIProjection) - secret = Field(SecretProjection) - - -class ProjectedVolumeSource(Model): +class SELinuxOptions(Model): """ - Represents a projected volume source + SELinuxOptions are the labels to be applied to the container """ - defaultMode = Field(int) - sources = ListField(VolumeProjection) + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) -class DownwardAPIVolumeSource(Model): +class PodSecurityContext(Model): """ - DownwardAPIVolumeSource represents a volume containing downward API info. - Downward API volumes support ownership management and SELinux relabeling. + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. """ - defaultMode = Field(int) - items = ListField(DownwardAPIVolumeFile) + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) -class EnvVarSource(Model): +class SecurityContext(Model): """ - EnvVarSource represents a source for the value of an EnvVar. + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. """ - configMapKeyRef = Field(ConfigMapKeySelector) - fieldRef = Field(ObjectFieldSelector) - resourceFieldRef = Field(ResourceFieldSelector) - secretKeyRef = Field(SecretKeySelector) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) -class EnvVar(Model): +class Toleration(Model): """ - EnvVar represents an environment variable present in a Container. + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . """ - name = Field(six.text_type) + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) value = Field(six.text_type) - valueFrom = Field(EnvVarSource) -class EmptyDirVolumeSource(Model): +class PodAffinityTerm(Model): """ - Represents an empty directory for a pod. Empty directory volumes support - ownership management and SELinux relabeling. + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running """ - medium = Field(six.text_type) + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) -class FlockerVolumeSource(Model): +class WeightedPodAffinityTerm(Model): """ - Represents a Flocker volume mounted by the Flocker agent. One and only one of - datasetName and datasetUUID should be set. Flocker volumes do not support - ownership management or SELinux relabeling. + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) """ - datasetName = Field(six.text_type) - datasetUUID = Field(six.text_type) + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) -class SecretEnvSource(Model): +class PodAffinity(Model): """ - SecretEnvSource selects a Secret to populate the environment variables with. - The contents of the target Secret's Data field will represent the key-value - pairs as environment variables. + Pod affinity is a group of inter pod affinity scheduling rules. """ - name = Field(six.text_type) - optional = Field(bool) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class EnvFromSource(Model): +class PodAntiAffinity(Model): """ - EnvFromSource represents the source of a set of ConfigMaps + Pod anti affinity is a group of inter pod anti affinity scheduling rules. """ - configMapRef = Field(ConfigMapEnvSource) - prefix = Field(six.text_type) - secretRef = Field(SecretEnvSource) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class AWSElasticBlockStoreVolumeSource(Model): +class DaemonEndpoint(Model): """ - Represents a Persistent Disk resource in AWS. - - An AWS EBS disk must exist - before mounting to a container. The disk must also be in the same AWS zone as - the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS - volumes support ownership management and SELinux relabeling. + DaemonEndpoint contains information about a single Daemon endpoint. """ - fsType = Field(six.text_type) - partition = Field(int) - readOnly = Field(bool) - volumeID = Field(six.text_type) + Port = RequiredField(int) -class Capabilities(Model): +class NodeDaemonEndpoints(Model): """ - Adds and removes POSIX capabilities from running containers. + NodeDaemonEndpoints lists ports opened by daemons running on the Node. """ - add = ListField(six.text_type) - drop = ListField(six.text_type) + kubeletEndpoint = Field(DaemonEndpoint) class ServicePort(Model): @@ -1384,7 +1129,7 @@ class ServicePort(Model): name = Field(six.text_type) nodePort = Field(int) - port = Field(int) + port = RequiredField(int) protocol = Field(six.text_type) targetPort = Field(six.text_type, alt_type=int) @@ -1429,7 +1174,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(ServiceSpec) - status = Field(ServiceStatus) + status = ReadOnlyField(ServiceStatus) class ServiceList(Model): @@ -1443,73 +1188,52 @@ class ServiceList(Model): metadata = Field(ListMeta) -class SELinuxOptions(Model): +class PodCondition(Model): """ - SELinuxOptions are the labels to be applied to the container + PodCondition contains details for the current condition of this pod. """ - level = Field(six.text_type) - role = Field(six.text_type) - type = Field(six.text_type) - user = Field(six.text_type) + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class SecurityContext(Model): +class PersistentVolumeClaimVolumeSource(Model): """ - SecurityContext holds security configuration that will be applied to a - container. Some fields are present in both SecurityContext and - PodSecurityContext. When both are set, the values in SecurityContext take - precedence. + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). """ - capabilities = Field(Capabilities) - privileged = Field(bool) - readOnlyRootFilesystem = Field(bool) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) + claimName = RequiredField(six.text_type) + readOnly = Field(bool) -class Container(Model): +class ConfigMapEnvSource(Model): """ - A single application container that you want to run within a pod. + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. """ - args = ListField(six.text_type) - command = ListField(six.text_type) - env = ListField(EnvVar) - envFrom = ListField(EnvFromSource) - image = Field(six.text_type) - imagePullPolicy = Field(six.text_type) - lifecycle = Field(Lifecycle) - livenessProbe = Field(Probe) name = Field(six.text_type) - ports = ListField(ContainerPort) - readinessProbe = Field(Probe) - resources = Field(ResourceRequirements) - securityContext = Field(SecurityContext) - stdin = Field(bool) - stdinOnce = Field(bool) - terminationMessagePath = Field(six.text_type) - terminationMessagePolicy = Field(six.text_type) - tty = Field(bool) - volumeMounts = ListField(VolumeMount) - workingDir = Field(six.text_type) + optional = Field(bool) -class PodSecurityContext(Model): +class EnvFromSource(Model): """ - PodSecurityContext holds pod-level security attributes and common container - settings. Some fields are also present in container.securityContext. Field - values of container.securityContext take precedence over field values of - PodSecurityContext. + EnvFromSource represents the source of a set of ConfigMaps """ - fsGroup = Field(int) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) - supplementalGroups = ListField(int) + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) class GlusterfsVolumeSource(Model): @@ -1518,75 +1242,78 @@ class GlusterfsVolumeSource(Model): volumes do not support ownership management or SELinux relabeling. """ - endpoints = Field(six.text_type) - path = Field(six.text_type) + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) readOnly = Field(bool) -class AzureFileVolumeSource(Model): +class ConfigMapKeySelector(Model): """ - AzureFile represents an Azure File Service mount on the host and bind mount to - the pod. + Selects a key from a ConfigMap. """ - readOnly = Field(bool) - secretName = Field(six.text_type) - shareName = Field(six.text_type) + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class LimitRangeItem(Model): +class NodeSelectorRequirement(Model): """ - LimitRangeItem defines a min/max usage limit for any resource that matches on - kind. + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - default = Field(dict) - defaultRequest = Field(dict) - max = Field(dict) - maxLimitRequestRatio = Field(dict) - min = Field(dict) - type = Field(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class LimitRangeSpec(Model): +class NodeSelectorTerm(Model): """ - LimitRangeSpec defines a min/max usage limit for resources that match on kind. + A null or empty node selector term matches no objects. """ - limits = ListField(LimitRangeItem) + matchExpressions = ListField(NodeSelectorRequirement) -class LimitRange(Model): +class NodeSelector(Model): """ - LimitRange sets resource usage limits for each kind of resource in a Namespace. + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/limitranges" - delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - list_all_url = "/api/v1/limitranges" - list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" - update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" - watchlist_all_url = "/api/v1/watch/limitranges" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRange") - metadata = Field(ObjectMeta) - spec = Field(LimitRangeSpec) + nodeSelectorTerms = ListField(NodeSelectorTerm) -class LimitRangeList(Model): +class PreferredSchedulingTerm(Model): """ - LimitRangeList is a list of LimitRange items. + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRangeList") - items = ListField(LimitRange) - metadata = Field(ListMeta) + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) class NodeSystemInfo(Model): @@ -1594,16 +1321,16 @@ class NodeSystemInfo(Model): NodeSystemInfo is a set of ids/uuids to uniquely identify the node. """ - architecture = Field(six.text_type) - bootID = Field(six.text_type) - containerRuntimeVersion = Field(six.text_type) - kernelVersion = Field(six.text_type) - kubeProxyVersion = Field(six.text_type) - kubeletVersion = Field(six.text_type) - machineID = Field(six.text_type) - operatingSystem = Field(six.text_type) - osImage = Field(six.text_type) - systemUUID = Field(six.text_type) + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) class NodeStatus(Model): @@ -1623,78 +1350,311 @@ class NodeStatus(Model): volumesInUse = ListField(six.text_type) -class Taint(Model): +class Node(Model): """ - The node this Taint is attached to has the effect 'effect' on any pod that that - does not tolerate the Taint. + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") - effect = Field(six.text_type) - key = Field(six.text_type) - timeAdded = Field(datetime.datetime) + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}/finalize" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) -class NodeSpec(Model): +class ProjectedVolumeSource(Model): """ - NodeSpec describes the attributes that a node is created with. + Represents a projected volume source """ - externalID = Field(six.text_type) - podCIDR = Field(six.text_type) - providerID = Field(six.text_type) - taints = ListField(Taint) - unschedulable = Field(bool) + defaultMode = Field(int) + sources = ListField(VolumeProjection) -class Node(Model): +class DownwardAPIVolumeSource(Model): """ - Node is a worker node in Kubernetes. Each node will have a unique identifier in - the cache (i.e. in etcd). + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. """ - class Meta: - create_url = "/api/v1/nodes" - delete_url = "/api/v1/nodes/{name}" - get_url = "/api/v1/nodes/{name}" - list_all_url = "/api/v1/nodes" - update_url = "/api/v1/nodes/{name}" - watch_url = "/api/v1/watch/nodes/{name}" - watchlist_all_url = "/api/v1/watch/nodes" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Node") - metadata = Field(ObjectMeta) - spec = Field(NodeSpec) - status = Field(NodeStatus) + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) -class NodeList(Model): +class NFSVolumeSource(Model): """ - NodeList is the whole list of all Nodes which have been registered with master. + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NodeList") - items = ListField(Node) - metadata = Field(ListMeta) + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) -class GCEPersistentDiskVolumeSource(Model): +class Volume(Model): """ - Represents a Persistent Disk resource in Google Compute Engine. - - A GCE PD must - exist before mounting to a container. The disk must also be in the same GCE - project and zone as the kubelet. A GCE PD can only be mounted as read/write - once or read-only many times. GCE PDs support ownership management and SELinux - relabeling. + Volume represents a named volume in a pod that may be accessed by any container + in the pod. """ - fsType = Field(six.text_type) - partition = Field(int) - pdName = Field(six.text_type) - readOnly = Field(bool) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) class PersistentVolumeSpec(Model): @@ -1748,7 +1708,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(PersistentVolumeSpec) - status = Field(PersistentVolumeStatus) + status = ReadOnlyField(PersistentVolumeStatus) class PersistentVolumeList(Model): @@ -1762,39 +1722,87 @@ class PersistentVolumeList(Model): metadata = Field(ListMeta) -class Volume(Model): +class ResourceRequirements(Model): """ - Volume represents a named volume in a pod that may be accessed by any container - in the pod. + ResourceRequirements describes the compute resource requirements. """ - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - configMap = Field(ConfigMapVolumeSource) - downwardAPI = Field(DownwardAPIVolumeSource) - emptyDir = Field(EmptyDirVolumeSource) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - gitRepo = Field(GitRepoVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - name = Field(six.text_type) - nfs = Field(NFSVolumeSource) - persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - projected = Field(ProjectedVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - secret = Field(SecretVolumeSource) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) class PodSpec(Model): @@ -1826,6 +1834,41 @@ class PodSpec(Model): volumes = ListField(Volume) +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + class PodTemplateSpec(Model): """ PodTemplateSpec describes the data a pod should have when created from a @@ -1867,7 +1910,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(ReplicationControllerSpec) - status = Field(ReplicationControllerStatus) + status = ReadOnlyField(ReplicationControllerStatus) class ReplicationControllerList(Model): @@ -1913,38 +1956,3 @@ class PodTemplateList(Model): items = ListField(PodTemplate) metadata = Field(ListMeta) - -class Pod(Model): - """ - Pod is a collection of containers that can run on a host. This resource is - created by clients and scheduled onto hosts. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods" - delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" - get_url = "/api/v1/namespaces/{namespace}/pods/{name}" - list_all_url = "/api/v1/pods" - list_ns_url = "/api/v1/namespaces/{namespace}/pods" - update_url = "/api/v1/namespaces/{namespace}/pods/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" - watchlist_all_url = "/api/v1/watch/pods" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Pod") - - metadata = Field(ObjectMeta) - spec = Field(PodSpec) - status = Field(PodStatus) - - -class PodList(Model): - """ - PodList is a list of Pods. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PodList") - - items = ListField(Pod) - metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py index 63f5453..1975e72 100644 --- a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py @@ -7,83 +7,66 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_6.kubernetes.api.v1 import PersistentVolumeClaim, PodTemplateSpec -class RollbackConfig(Model): - """ - - """ - - revision = Field(int) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### -class DeploymentRollback(Model): - """ - DeploymentRollback stores the information required to rollback a deployment. - """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - - name = Field(six.text_type) - rollbackTo = Field(RollbackConfig) - updatedAnnotations = Field(dict) - - -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DeploymentStrategy(Model): +class StatefulSetSpec(Model): """ - DeploymentStrategy describes how to replace existing pods with new ones. + A StatefulSetSpec is the specification of a StatefulSet. """ - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) + replicas = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + volumeClaimTemplates = ListField(PersistentVolumeClaim) -class DeploymentSpec(Model): +class ScaleStatus(Model): """ - DeploymentSpec is the specification of the desired behavior of the Deployment. + ScaleStatus represents the current status of a scale subresource. """ - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = Field(PodTemplateSpec) + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) -class StatefulSetSpec(Model): +class DeploymentCondition(Model): """ - A StatefulSetSpec is the specification of a StatefulSet. + DeploymentCondition describes the state of a deployment at a certain point. """ - replicas = Field(int) - selector = Field(LabelSelector) - serviceName = Field(six.text_type) - template = Field(PodTemplateSpec) - volumeClaimTemplates = ListField(PersistentVolumeClaim) + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class ScaleSpec(Model): +class DeploymentStatus(Model): """ - ScaleSpec describes the attributes of a scale subresource + DeploymentStatus is the most recently observed status of the Deployment. """ + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) class StatefulSetStatus(Model): @@ -92,7 +75,7 @@ class StatefulSetStatus(Model): """ observedGeneration = Field(int) - replicas = Field(int) + replicas = RequiredField(int) class StatefulSet(Model): @@ -135,31 +118,78 @@ class StatefulSetList(Model): metadata = Field(ListMeta) -class DeploymentCondition(Model): +class RollbackConfig(Model): """ - DeploymentCondition describes the state of a deployment at a certain point. + """ - lastTransitionTime = Field(datetime.datetime) - lastUpdateTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) + revision = Field(int) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) type = Field(six.text_type) -class DeploymentStatus(Model): +class DeploymentSpec(Model): """ - DeploymentStatus is the most recently observed status of the Deployment. + DeploymentSpec is the specification of the desired behavior of the Deployment. """ - availableReplicas = Field(int) - conditions = ListField(DeploymentCondition) - observedGeneration = Field(int) - readyReplicas = Field(int) + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) replicas = Field(int) - unavailableReplicas = Field(int) - updatedReplicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) class Deployment(Model): @@ -195,25 +225,3 @@ class DeploymentList(Model): items = ListField(Deployment) metadata = Field(ListMeta) - -class ScaleStatus(Model): - """ - ScaleStatus represents the current status of a scale subresource. - """ - - replicas = Field(int) - selector = Field(dict) - targetSelector = Field(six.text_type) - - -class Scale(Model): - """ - Scale represents a scaling request for a resource. - """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "Scale") - - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = Field(ScaleStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py index 4d95be5..a860d53 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class TokenReviewSpec(Model): """ TokenReviewSpec is a description of the token authentication request. @@ -52,6 +60,6 @@ class Meta: kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) - spec = Field(TokenReviewSpec) + spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py index 57d6465..a5b8f7b 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py @@ -5,10 +5,26 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + class UserInfo(Model): """ UserInfo holds the information about the user needed to implement the user.Info @@ -31,14 +47,6 @@ class TokenReviewStatus(Model): user = Field(UserInfo) -class TokenReviewSpec(Model): - """ - TokenReviewSpec is a description of the token authentication request. - """ - - token = Field(six.text_type) - - class TokenReview(Model): """ TokenReview attempts to authenticate a token to a known user. Note: TokenReview @@ -52,6 +60,6 @@ class Meta: kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) - spec = Field(TokenReviewSpec) + spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py index 89d19b9..e557ffe 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py @@ -5,10 +5,28 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + class ResourceAttributes(Model): """ ResourceAttributes includes the authorization attributes available for resource @@ -24,24 +42,18 @@ class ResourceAttributes(Model): version = Field(six.text_type) -class SubjectAccessReviewStatus(Model): - """ - SubjectAccessReviewStatus - """ - - allowed = Field(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) - - -class NonResourceAttributes(Model): +class SubjectAccessReviewSpec(Model): """ - NonResourceAttributes includes the authorization attributes available for non- - resource requests to the Authorizer interface + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set """ - path = Field(six.text_type) - verb = Field(six.text_type) + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) class SelfSubjectAccessReviewSpec(Model): @@ -55,36 +67,14 @@ class SelfSubjectAccessReviewSpec(Model): resourceAttributes = Field(ResourceAttributes) -class SelfSubjectAccessReview(Model): - """ - SelfSubjectAccessReview checks whether or the current user can perform an - action. Not filling in a spec.namespace means 'in all namespaces'. Self is a - special case, because users should always be able to check whether they can - perform an action - """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "SelfSubjectAccessReview") - - metadata = Field(ObjectMeta) - spec = Field(SelfSubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) - - -class SubjectAccessReviewSpec(Model): +class SubjectAccessReviewStatus(Model): """ - SubjectAccessReviewSpec is a description of the access request. Exactly one of - ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be - set + SubjectAccessReviewStatus """ - extra = Field(dict) - groups = ListField(six.text_type) - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) - user = Field(six.text_type) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class SubjectAccessReview(Model): @@ -99,7 +89,25 @@ class Meta: kind = Field(six.text_type, "SubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) @@ -116,6 +124,6 @@ class Meta: kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py index 4791d6f..4f2f67c 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py @@ -5,18 +5,31 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta -class SubjectAccessReviewStatus(Model): +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceAttributes(Model): """ - SubjectAccessReviewStatus + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface """ - allowed = Field(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) class NonResourceAttributes(Model): @@ -29,19 +42,15 @@ class NonResourceAttributes(Model): verb = Field(six.text_type) -class ResourceAttributes(Model): +class SelfSubjectAccessReviewSpec(Model): """ - ResourceAttributes includes the authorization attributes available for resource - requests to the Authorizer interface + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set """ - group = Field(six.text_type) - name = Field(six.text_type) - namespace = Field(six.text_type) - resource = Field(six.text_type) - subresource = Field(six.text_type) - verb = Field(six.text_type) - version = Field(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) class SubjectAccessReviewSpec(Model): @@ -58,20 +67,14 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SubjectAccessReview(Model): +class SubjectAccessReviewStatus(Model): """ - SubjectAccessReview checks whether or not a user or group can perform an - action. + SubjectAccessReviewStatus """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "SubjectAccessReview") - metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class LocalSubjectAccessReview(Model): @@ -87,19 +90,24 @@ class Meta: kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) -class SelfSubjectAccessReviewSpec(Model): +class SubjectAccessReview(Model): """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set + SubjectAccessReview checks whether or not a user or group can perform an + action. """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) class SelfSubjectAccessReview(Model): @@ -116,6 +124,6 @@ class Meta: kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SelfSubjectAccessReviewSpec) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py index feffb50..d918683 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py @@ -7,10 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class ScaleSpec(Model): """ ScaleSpec describes the attributes of a scale subresource. @@ -19,25 +27,13 @@ class ScaleSpec(Model): replicas = Field(int) -class HorizontalPodAutoscalerStatus(Model): - """ - current status of a horizontal pod autoscaler - """ - - currentCPUUtilizationPercentage = Field(int) - currentReplicas = Field(int) - desiredReplicas = Field(int) - lastScaleTime = Field(datetime.datetime) - observedGeneration = Field(int) - - class CrossVersionObjectReference(Model): """ CrossVersionObjectReference contains enough information to let you identify the referred resource. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) class HorizontalPodAutoscalerSpec(Model): @@ -45,12 +41,45 @@ class HorizontalPodAutoscalerSpec(Model): specification of a horizontal pod autoscaler. """ - maxReplicas = Field(int) + maxReplicas = RequiredField(int) minReplicas = Field(int) - scaleTargetRef = Field(CrossVersionObjectReference) + scaleTargetRef = RequiredField(CrossVersionObjectReference) targetCPUUtilizationPercentage = Field(int) +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. @@ -84,24 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - -class ScaleStatus(Model): - """ - ScaleStatus represents the current status of a scale subresource. - """ - - replicas = Field(int) - selector = Field(six.text_type) - - -class Scale(Model): - """ - Scale represents a scaling request for a resource. - """ - apiVersion = Field(six.text_type, "autoscaling/v1") - kind = Field(six.text_type, "Scale") - - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = Field(ScaleStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py index 551fd2e..871b259 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py @@ -7,17 +7,60 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) + + class CrossVersionObjectReference(Model): """ CrossVersionObjectReference contains enough information to let you identify the referred resource. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) class ObjectMetricStatus(Model): @@ -26,9 +69,33 @@ class ObjectMetricStatus(Model): kubernetes object (for example, hits-per-second on an Ingress object). """ - currentValue = Field(six.text_type) - metricName = Field(six.text_type) - target = Field(CrossVersionObjectReference) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) class ObjectMetricSource(Model): @@ -37,9 +104,9 @@ class ObjectMetricSource(Model): object (for example, hits-per-second on an Ingress object). """ - metricName = Field(six.text_type) - target = Field(CrossVersionObjectReference) - targetValue = Field(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) class ResourceMetricSource(Model): @@ -53,36 +120,11 @@ class ResourceMetricSource(Model): be set. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) targetAverageUtilization = Field(int) targetAverageValue = Field(six.text_type) -class ResourceMetricStatus(Model): - """ - ResourceMetricStatus indicates the current value of a resource metric known to - Kubernetes, as specified in requests and limits, describing each pod in the - current scale target (e.g. CPU or memory). Such metrics are built in to - Kubernetes, and have special scaling options on top of those available to - normal per-pod metrics using the 'pods' source. - """ - - currentAverageUtilization = Field(int) - currentAverageValue = Field(six.text_type) - name = Field(six.text_type) - - -class PodsMetricSource(Model): - """ - PodsMetricSource indicates how to scale on a metric describing each pod in the - current scale target (for example, transactions-processed-per-second). The - values will be averaged together before being compared to the target value. - """ - - metricName = Field(six.text_type) - targetAverageValue = Field(six.text_type) - - class MetricSpec(Model): """ MetricSpec specifies how to scale based on a single metric (only `type` and one @@ -92,7 +134,7 @@ class MetricSpec(Model): object = Field(ObjectMetricSource) pods = Field(PodsMetricSource) resource = Field(ResourceMetricSource) - type = Field(six.text_type) + type = RequiredField(six.text_type) class HorizontalPodAutoscalerSpec(Model): @@ -101,44 +143,10 @@ class HorizontalPodAutoscalerSpec(Model): HorizontalPodAutoscaler. """ - maxReplicas = Field(int) + maxReplicas = RequiredField(int) metrics = ListField(MetricSpec) minReplicas = Field(int) - scaleTargetRef = Field(CrossVersionObjectReference) - - -class PodsMetricStatus(Model): - """ - PodsMetricStatus indicates the current value of a metric describing each pod in - the current scale target (for example, transactions-processed-per-second). - """ - - currentAverageValue = Field(six.text_type) - metricName = Field(six.text_type) - - -class MetricStatus(Model): - """ - MetricStatus describes the last-read state of a single metric. - """ - - object = Field(ObjectMetricStatus) - pods = Field(PodsMetricStatus) - resource = Field(ResourceMetricStatus) - type = Field(six.text_type) - - -class HorizontalPodAutoscalerStatus(Model): - """ - HorizontalPodAutoscalerStatus describes the current status of a horizontal pod - autoscaler. - """ - - currentMetrics = ListField(MetricStatus) - currentReplicas = Field(int) - desiredReplicas = Field(int) - lastScaleTime = Field(datetime.datetime) - observedGeneration = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) class HorizontalPodAutoscaler(Model): diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v1.py b/k8s/models/v1_6/kubernetes/apis/batch/v1.py index b35a7be..c0aa6ca 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v1.py @@ -7,11 +7,32 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_6.kubernetes.api.v1 import PodTemplateSpec +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + class JobCondition(Model): """ JobCondition describes current state of a job. @@ -21,8 +42,8 @@ class JobCondition(Model): lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class JobStatus(Model): @@ -38,19 +59,6 @@ class JobStatus(Model): succeeded = Field(int) -class JobSpec(Model): - """ - JobSpec describes how the job execution will look like. - """ - - activeDeadlineSeconds = Field(int) - completions = Field(int) - manualSelector = Field(bool) - parallelism = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) - - class Job(Model): """ Job represents the configuration of a single job. diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py index 2ab9904..9e6d990 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -7,12 +7,20 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta from k8s.models.v1_6.kubernetes.api.v1 import ObjectReference from k8s.models.v1_6.kubernetes.apis.batch.v1 import JobSpec +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class CronJobStatus(Model): """ CronJobStatus represents the current state of a cron job. @@ -40,8 +48,8 @@ class CronJobSpec(Model): concurrencyPolicy = Field(six.text_type) failedJobsHistoryLimit = Field(int) - jobTemplate = Field(JobTemplateSpec) - schedule = Field(six.text_type) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) startingDeadlineSeconds = Field(int) successfulJobsHistoryLimit = Field(int) suspend = Field(bool) diff --git a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py index 25cb2cb..58fb073 100644 --- a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py @@ -7,10 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class CertificateSigningRequestSpec(Model): """ This information is immutable after the request is created. Only the Request @@ -20,7 +28,7 @@ class CertificateSigningRequestSpec(Model): extra = Field(dict) groups = ListField(six.text_type) - request = Field(six.text_type) + request = RequiredField(six.text_type) uid = Field(six.text_type) usages = ListField(six.text_type) username = Field(six.text_type) @@ -34,7 +42,7 @@ class CertificateSigningRequestCondition(Model): lastUpdateTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - type = Field(six.text_type) + type = RequiredField(six.text_type) class CertificateSigningRequestStatus(Model): diff --git a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py index fc1d8b3..dc8a064 100644 --- a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py @@ -7,191 +7,76 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_6.kubernetes.api.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions -class IngressBackend(Model): - """ - IngressBackend describes all endpoints for a given service and port. - """ - - serviceName = Field(six.text_type) - servicePort = Field(six.text_type, alt_type=int) - - -class HTTPIngressPath(Model): - """ - HTTPIngressPath associates a path regex with a backend. Incoming urls matching - the path are forwarded to the backend. - """ - - backend = Field(IngressBackend) - path = Field(six.text_type) - +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### -class HTTPIngressRuleValue(Model): - """ - HTTPIngressRuleValue is a list of http selectors pointing to backends. In the - example: http:///? -> backend where where parts of the - url correspond to RFC 3986, this resource will be used to match against - everything after the last '/' and before the first '?' or '#'. - """ - - paths = ListField(HTTPIngressPath) - - -class IngressRule(Model): - """ - IngressRule represents the rules mapping the paths under a specified host to - the related backend services. Incoming requests are first evaluated for a host - match, then routed to the backend associated with the matching - IngressRuleValue. - """ - - host = Field(six.text_type) - http = Field(HTTPIngressRuleValue) - - -class NetworkPolicyPeer(Model): - """ - - """ - namespaceSelector = Field(LabelSelector) - podSelector = Field(LabelSelector) - - -class DeploymentCondition(Model): - """ - DeploymentCondition describes the state of a deployment at a certain point. - """ - - lastTransitionTime = Field(datetime.datetime) - lastUpdateTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) - - -class DeploymentStatus(Model): - """ - DeploymentStatus is the most recently observed status of the Deployment. - """ - - availableReplicas = Field(int) - conditions = ListField(DeploymentCondition) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = Field(int) - unavailableReplicas = Field(int) - updatedReplicas = Field(int) - - -class HostPortRange(Model): +class APIVersion(Model): """ - Host Port Range defines a range of host ports that will be enabled by a policy - for pods to use. It requires both the start and end to be defined. + An APIVersion represents a single concrete version of an object model. """ - max = Field(int) - min = Field(int) + name = Field(six.text_type) -class RollingUpdateDaemonSet(Model): - """ - Spec to control the desired behavior of daemon set rolling update. +class ThirdPartyResource(Model): """ - - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DaemonSetUpdateStrategy(Model): + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. """ + class Meta: + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - """ - - rollingUpdate = Field(RollingUpdateDaemonSet) - type = Field(six.text_type) - - -class DaemonSetSpec(Model): - """ - DaemonSetSpec is the specification of a daemon set. - """ - - minReadySeconds = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) - templateGeneration = Field(int) - updateStrategy = Field(DaemonSetUpdateStrategy) - - -class ScaleSpec(Model): - """ - describes the attributes of a scale subresource - """ - - replicas = Field(int) - - -class ReplicaSetCondition(Model): - """ - ReplicaSetCondition describes the state of a replica set at a certain point. - """ - - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) - - -class ReplicaSetStatus(Model): - """ - ReplicaSetStatus represents the current status of a ReplicaSet. - """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResource") - availableReplicas = Field(int) - conditions = ListField(ReplicaSetCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = Field(int) + description = Field(six.text_type) + metadata = Field(ObjectMeta) + versions = ListField(APIVersion) -class ScaleStatus(Model): +class ThirdPartyResourceList(Model): """ - represents the current status of a scale subresource. + ThirdPartyResourceList is a list of ThirdPartyResources. """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResourceList") - replicas = Field(int) - selector = Field(dict) - targetSelector = Field(six.text_type) + items = ListField(ThirdPartyResource) + metadata = Field(ListMeta) -class Scale(Model): +class IngressTLS(Model): """ - represents a scaling request for a resource. + IngressTLS describes the transport layer security associated with an Ingress. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Scale") - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = Field(ScaleStatus) + hosts = ListField(six.text_type) + secretName = Field(six.text_type) -class SELinuxStrategyOptions(Model): +class IngressStatus(Model): """ - SELinux Strategy Options defines the strategy type and any options used to - create the strategy. + IngressStatus describe the current state of the Ingress. """ - rule = Field(six.text_type) - seLinuxOptions = Field(SELinuxOptions) + loadBalancer = Field(LoadBalancerStatus) class IDRange(Model): @@ -199,8 +84,8 @@ class IDRange(Model): ID Range provides a min/max of an allowed range of IDs. """ - max = Field(int) - min = Field(int) + max = RequiredField(int) + min = RequiredField(int) class RunAsUserStrategyOptions(Model): @@ -210,7 +95,7 @@ class RunAsUserStrategyOptions(Model): """ ranges = ListField(IDRange) - rule = Field(six.text_type) + rule = RequiredField(six.text_type) class SupplementalGroupsStrategyOptions(Model): @@ -233,57 +118,41 @@ class FSGroupStrategyOptions(Model): rule = Field(six.text_type) -class PodSecurityPolicySpec(Model): +class DeploymentCondition(Model): """ - Pod Security Policy Spec defines the policy enforced. + DeploymentCondition describes the state of a deployment at a certain point. """ - allowedCapabilities = ListField(six.text_type) - defaultAddCapabilities = ListField(six.text_type) - fsGroup = Field(FSGroupStrategyOptions) - hostIPC = Field(bool) - hostNetwork = Field(bool) - hostPID = Field(bool) - hostPorts = ListField(HostPortRange) - privileged = Field(bool) - readOnlyRootFilesystem = Field(bool) - requiredDropCapabilities = ListField(six.text_type) - runAsUser = Field(RunAsUserStrategyOptions) - seLinux = Field(SELinuxStrategyOptions) - supplementalGroups = Field(SupplementalGroupsStrategyOptions) - volumes = ListField(six.text_type) + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class PodSecurityPolicy(Model): +class DeploymentStatus(Model): """ - Pod Security Policy governs the ability to make requests that affect the - Security Context that will be applied to a pod and container. + DeploymentStatus is the most recently observed status of the Deployment. """ - class Meta: - create_url = "/apis/extensions/v1beta1/podsecuritypolicies" - delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" - get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" - list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" - update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" - watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "PodSecurityPolicy") - metadata = Field(ObjectMeta) - spec = Field(PodSecurityPolicySpec) + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) -class PodSecurityPolicyList(Model): +class SELinuxStrategyOptions(Model): """ - Pod Security Policy List is a list of PodSecurityPolicy objects. + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "PodSecurityPolicyList") - items = ListField(PodSecurityPolicy) - metadata = Field(ListMeta) + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) class NetworkPolicyPort(Model): @@ -295,124 +164,111 @@ class NetworkPolicyPort(Model): protocol = Field(six.text_type) -class NetworkPolicyIngressRule(Model): +class DaemonSetStatus(Model): """ - This NetworkPolicyIngressRule matches traffic if and only if the traffic - matches both ports AND from. + DaemonSetStatus represents the current status of a daemon set. """ - _from = ListField(NetworkPolicyPeer) - ports = ListField(NetworkPolicyPort) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) -class NetworkPolicySpec(Model): +class RollingUpdateDaemonSet(Model): """ - + Spec to control the desired behavior of daemon set rolling update. """ - ingress = ListField(NetworkPolicyIngressRule) - podSelector = Field(LabelSelector) + maxUnavailable = Field(six.text_type, alt_type=int) -class NetworkPolicy(Model): - """ - +class DaemonSetUpdateStrategy(Model): """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - list_all_url = "/apis/extensions/v1beta1/networkpolicies" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicy") - - metadata = Field(ObjectMeta) - spec = Field(NetworkPolicySpec) - - -class NetworkPolicyList(Model): - """ - Network Policy List is a list of NetworkPolicy objects. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicyList") - - items = ListField(NetworkPolicy) - metadata = Field(ListMeta) - -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) -class DeploymentStrategy(Model): +class DaemonSetSpec(Model): """ - DeploymentStrategy describes how to replace existing pods with new ones. + DaemonSetSpec is the specification of a daemon set. """ - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) + minReadySeconds = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) -class APIVersion(Model): +class DaemonSet(Model): """ - An APIVersion represents a single concrete version of an object model. + DaemonSet represents the configuration of a daemon set. """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") - name = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) -class ThirdPartyResource(Model): +class DaemonSetList(Model): """ - A ThirdPartyResource is a generic representation of a resource, it is used by - add-ons and plugins to add new resource types to the API. It consists of one - or more Versions of the api. + DaemonSetList is a collection of daemon sets. """ - class Meta: - create_url = "/apis/extensions/v1beta1/thirdpartyresources" - delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" - update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResource") + kind = Field(six.text_type, "DaemonSetList") - description = Field(six.text_type) - metadata = Field(ObjectMeta) - versions = ListField(APIVersion) + items = ListField(DaemonSet) + metadata = Field(ListMeta) -class ThirdPartyResourceList(Model): +class ReplicaSetSpec(Model): """ - ThirdPartyResourceList is a list of ThirdPartyResources. + ReplicaSetSpec is the specification of a ReplicaSet. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResourceList") - items = ListField(ThirdPartyResource) - metadata = Field(ListMeta) + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) -class IngressStatus(Model): +class RollingUpdateDeployment(Model): """ - IngressStatus describe the current state of the Ingress. + Spec to control the desired behavior of rolling update. """ - loadBalancer = Field(LoadBalancerStatus) + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) class RollbackConfig(Model): @@ -430,8 +286,8 @@ class DeploymentRollback(Model): apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DeploymentRollback") - name = Field(six.text_type) - rollbackTo = Field(RollbackConfig) + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) updatedAnnotations = Field(dict) @@ -448,7 +304,7 @@ class DeploymentSpec(Model): rollbackTo = Field(RollbackConfig) selector = Field(LabelSelector) strategy = Field(DeploymentStrategy) - template = Field(PodTemplateSpec) + template = RequiredField(PodTemplateSpec) class Deployment(Model): @@ -485,62 +341,54 @@ class DeploymentList(Model): metadata = Field(ListMeta) -class DaemonSetStatus(Model): +class ScaleSpec(Model): """ - DaemonSetStatus represents the current status of a daemon set. + describes the attributes of a scale subresource """ - currentNumberScheduled = Field(int) - desiredNumberScheduled = Field(int) - numberAvailable = Field(int) - numberMisscheduled = Field(int) - numberReady = Field(int) - numberUnavailable = Field(int) - observedGeneration = Field(int) - updatedNumberScheduled = Field(int) + replicas = Field(int) -class DaemonSet(Model): +class IngressBackend(Model): """ - DaemonSet represents the configuration of a daemon set. + IngressBackend describes all endpoints for a given service and port. """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - list_all_url = "/apis/extensions/v1beta1/daemonsets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSet") - metadata = Field(ObjectMeta) - spec = Field(DaemonSetSpec) - status = Field(DaemonSetStatus) + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) -class DaemonSetList(Model): +class HTTPIngressPath(Model): """ - DaemonSetList is a collection of daemon sets. + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSetList") - items = ListField(DaemonSet) - metadata = Field(ListMeta) + backend = RequiredField(IngressBackend) + path = Field(six.text_type) -class IngressTLS(Model): +class HTTPIngressRuleValue(Model): """ - IngressTLS describes the transport layer security associated with an Ingress. + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. """ - hosts = ListField(six.text_type) - secretName = Field(six.text_type) + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) class IngressSpec(Model): @@ -590,15 +438,175 @@ class IngressList(Model): metadata = Field(ListMeta) -class ReplicaSetSpec(Model): +class HostPortRange(Model): """ - ReplicaSetSpec is the specification of a ReplicaSet. + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. """ - minReadySeconds = Field(int) - replicas = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) + max = RequiredField(int) + min = RequiredField(int) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowedCapabilities = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + + +class NetworkPolicyPeer(Model): + """ + + """ + + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicySpec(Model): + """ + + """ + + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + + +class NetworkPolicy(Model): + """ + + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + Network Policy List is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) class ReplicaSet(Model): @@ -621,7 +629,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(ReplicaSetSpec) - status = Field(ReplicaSetStatus) + status = ReadOnlyField(ReplicaSetStatus) class ReplicaSetList(Model): diff --git a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py index 2158dca..f87ba05 100644 --- a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py @@ -5,21 +5,42 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + class PodDisruptionBudgetStatus(Model): """ PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system. """ - currentHealthy = Field(int) - desiredHealthy = Field(int) - disruptedPods = Field(dict) - disruptionsAllowed = Field(int) - expectedPods = Field(int) + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) observedGeneration = Field(int) @@ -66,16 +87,3 @@ class PodDisruptionBudgetList(Model): items = ListField(PodDisruptionBudget) metadata = Field(ListMeta) - -class Eviction(Model): - """ - Eviction evicts a pod from its node subject to certain policies and safety - constraints. This is a subresource of Pod. A request to cause such an eviction - is created by POSTing to .../pods//evictions. - """ - apiVersion = Field(six.text_type, "policy/v1beta1") - kind = Field(six.text_type, "Eviction") - - deleteOptions = Field(DeleteOptions) - metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py index b59e039..0b4a6c9 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class Subject(Model): """ Subject contains a reference to the object or user identities a role binding @@ -16,10 +24,91 @@ class Subject(Model): non-objects such as user and group names. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) namespace = Field(six.text_type) +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + class PolicyRule(Model): """ PolicyRule holds information that describes a policy rule, but does not contain @@ -99,84 +188,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - -class RoleRef(Model): - """ - RoleRef contains information that points to the role being used - """ - - apiGroup = Field(six.text_type) - name = Field(six.text_type) - - -class ClusterRoleBinding(Model): - """ - ClusterRoleBinding references a ClusterRole, but not contain it. It can - reference a ClusterRole in the global namespace, and adds who information via - Subject. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" - delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" - update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "ClusterRoleBinding") - - metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) - subjects = ListField(Subject) - - -class ClusterRoleBindingList(Model): - """ - ClusterRoleBindingList is a collection of ClusterRoleBindings - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "ClusterRoleBindingList") - - items = ListField(ClusterRoleBinding) - metadata = Field(ListMeta) - - -class RoleBinding(Model): - """ - RoleBinding references a role, but does not contain it. It can reference a - Role in the same namespace or a ClusterRole in the global namespace. It adds - who information via Subjects and namespace information by which namespace it - exists in. RoleBindings in a given namespace only have effect in that - namespace. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" - delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" - list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" - update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" - watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "RoleBinding") - - metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) - subjects = ListField(Subject) - - -class RoleBindingList(Model): - """ - RoleBindingList is a collection of RoleBindings - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "RoleBindingList") - - items = ListField(RoleBinding) - metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py index ff6ce99..8a83d8a 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py @@ -5,17 +5,16 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta -class RoleRef(Model): - """ - RoleRef contains information that points to the role being used - """ - - apiGroup = Field(six.text_type) - name = Field(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class Subject(Model): @@ -26,10 +25,19 @@ class Subject(Model): """ apiGroup = Field(six.text_type) - name = Field(six.text_type) + name = RequiredField(six.text_type) namespace = Field(six.text_type) +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + class RoleBinding(Model): """ RoleBinding references a role, but does not contain it. It can reference a @@ -53,7 +61,7 @@ class Meta: kind = Field(six.text_type, "RoleBinding") metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) + roleRef = RequiredField(RoleRef) subjects = ListField(Subject) @@ -87,7 +95,7 @@ class Meta: kind = Field(six.text_type, "ClusterRoleBinding") metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) + roleRef = RequiredField(RoleRef) subjects = ListField(Subject) @@ -116,38 +124,6 @@ class PolicyRule(Model): verbs = ListField(six.text_type) -class ClusterRole(Model): - """ - ClusterRole is a cluster level, logical grouping of PolicyRules that can be - referenced as a unit by a RoleBinding or ClusterRoleBinding. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" - delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" - update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "ClusterRole") - - metadata = Field(ObjectMeta) - rules = ListField(PolicyRule) - - -class ClusterRoleList(Model): - """ - ClusterRoleList is a collection of ClusterRoles - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "ClusterRoleList") - - items = ListField(ClusterRole) - metadata = Field(ListMeta) - - class Role(Model): """ Role is a namespaced, logical grouping of PolicyRules that can be referenced as @@ -181,3 +157,35 @@ class RoleList(Model): items = ListField(Role) metadata = Field(ListMeta) + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py index 5a24fef..285da22 100644 --- a/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py @@ -10,6 +10,14 @@ from k8s.models.v1_6.kubernetes.api.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class PodPresetSpec(Model): """ PodPresetSpec is a description of a pod injection policy. diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1.py index 1546e69..4384da7 100644 --- a/k8s/models/v1_6/kubernetes/apis/storage/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class StorageClass(Model): """ StorageClass describes the parameters for a class of storage for which @@ -32,7 +40,7 @@ class Meta: metadata = Field(ObjectMeta) parameters = Field(dict) - provisioner = Field(six.text_type) + provisioner = RequiredField(six.text_type) class StorageClassList(Model): diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py index fb13d64..f45bf77 100644 --- a/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class StorageClass(Model): """ StorageClass describes the parameters for a class of storage for which @@ -32,7 +40,7 @@ class Meta: metadata = Field(ObjectMeta) parameters = Field(dict) - provisioner = Field(six.text_type) + provisioner = RequiredField(six.text_type) class StorageClassList(Model): diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py index 568d961..d604a8e 100644 --- a/k8s/models/v1_7/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -7,10 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_7.apimachinery.runtime import RawExtension +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class ListMeta(Model): """ ListMeta describes metadata that synthetic resources must have, including lists @@ -18,8 +26,30 @@ class ListMeta(Model): ListMeta}. """ - resourceVersion = Field(six.text_type) - selfLink = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) class WatchEvent(Model): @@ -29,72 +59,64 @@ class WatchEvent(Model): apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "WatchEvent") - object = Field(RawExtension) - type = Field(six.text_type) + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) -class StatusCause(Model): +class LabelSelectorRequirement(Model): """ - StatusCause provides more information about an api.Status failure, including - cases when multiple errors are encountered. + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - field = Field(six.text_type) - message = Field(six.text_type) - reason = Field(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class StatusDetails(Model): +class LabelSelector(Model): """ - StatusDetails is a set of additional properties that MAY be set by the server - to provide additional information about a response. The Reason field of a - Status object defines what attributes will be set. Clients must ignore fields - that do not match the defined type of each attribute, and should assume that - any attribute may be empty, invalid, or under defined. + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. """ - causes = ListField(StatusCause) - group = Field(six.text_type) - name = Field(six.text_type) - retryAfterSeconds = Field(int) - uid = Field(six.text_type) + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) -class Status(Model): +class APIResource(Model): """ - Status is a return value for calls that don't return other objects. + APIResource specifies the name of a resource and whether it is namespaced. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Status") - code = Field(int) - details = Field(StatusDetails) - message = Field(six.text_type) - metadata = Field(ListMeta) - reason = Field(six.text_type) - status = Field(six.text_type) + categories = ListField(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) -class ServerAddressByClientCIDR(Model): +class APIResourceList(Model): """ - ServerAddressByClientCIDR helps the client to determine the server address that - they should use, depending on the clientCIDR that they match. + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") - clientCIDR = Field(six.text_type) - serverAddress = Field(six.text_type) + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) -class APIVersions(Model): +class Initializer(Model): """ - APIVersions lists the versions that are available, to allow clients to discover - the API at /api, which is the root path of the legacy v1 API. + Initializer is information about an initializer that has not yet completed. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "APIVersions") - serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) - versions = ListField(six.text_type) + name = RequiredField(six.text_type) class GroupVersionForDiscovery(Model): @@ -103,8 +125,8 @@ class GroupVersionForDiscovery(Model): is made a struct to keep extensibility. """ - groupVersion = Field(six.text_type) - version = Field(six.text_type) + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) class APIGroup(Model): @@ -115,7 +137,7 @@ class APIGroup(Model): apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "APIGroup") - name = Field(six.text_type) + name = RequiredField(six.text_type) preferredVersion = Field(GroupVersionForDiscovery) serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) versions = ListField(GroupVersionForDiscovery) @@ -132,30 +154,17 @@ class APIGroupList(Model): groups = ListField(APIGroup) -class APIResource(Model): - """ - APIResource specifies the name of a resource and whether it is namespaced. - """ - - categories = ListField(six.text_type) - name = Field(six.text_type) - namespaced = Field(bool) - shortNames = ListField(six.text_type) - singularName = Field(six.text_type) - verbs = ListField(six.text_type) - - -class APIResourceList(Model): +class OwnerReference(Model): """ - APIResourceList is a list of APIResource, it is used to expose the name of the - resources supported in a specific group and version, and if the resource is - namespaced. + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "APIResourceList") - groupVersion = Field(six.text_type) - resources = ListField(APIResource) + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) class Preconditions(Model): @@ -180,56 +189,55 @@ class DeleteOptions(Model): propagationPolicy = Field(six.text_type) -class Initializer(Model): - """ - Initializer is information about an initializer that has not yet completed. - """ - - name = Field(six.text_type) - - -class Initializers(Model): +class StatusCause(Model): """ - Initializers tracks the progress of initialization. + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. """ - pending = ListField(Initializer) - result = Field(Status) + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) -class LabelSelectorRequirement(Model): +class StatusDetails(Model): """ - A label selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. """ - key = Field(six.text_type) - operator = Field(six.text_type) - values = ListField(six.text_type) + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) -class LabelSelector(Model): +class Status(Model): """ - A label selector is a label query over a set of resources. The result of - matchLabels and matchExpressions are ANDed. An empty label selector matches all - objects. A null label selector matches no objects. + Status is a return value for calls that don't return other objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") - matchExpressions = ListField(LabelSelectorRequirement) - matchLabels = Field(dict) + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) -class OwnerReference(Model): +class Initializers(Model): """ - OwnerReference contains enough information to let you identify an owning - object. Currently, an owning object must be in the same namespace, so there is - no namespace field. + Initializers tracks the progress of initialization. """ - blockOwnerDeletion = Field(bool) - controller = Field(bool) - name = Field(six.text_type) - uid = Field(six.text_type) + pending = ListField(Initializer) + result = Field(Status) class ObjectMeta(Model): @@ -240,18 +248,18 @@ class ObjectMeta(Model): annotations = Field(dict) clusterName = Field(six.text_type) - creationTimestamp = Field(datetime.datetime) - deletionGracePeriodSeconds = Field(int) - deletionTimestamp = Field(datetime.datetime) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) finalizers = ListField(six.text_type) generateName = Field(six.text_type) - generation = Field(int) + generation = ReadOnlyField(int) initializers = Field(Initializers) labels = Field(dict) name = Field(six.text_type) namespace = Field(six.text_type) ownerReferences = ListField(OwnerReference) - resourceVersion = Field(six.text_type) - selfLink = Field(six.text_type) - uid = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) diff --git a/k8s/models/v1_7/apimachinery/runtime.py b/k8s/models/v1_7/apimachinery/runtime.py index 5110035..e483edb 100644 --- a/k8s/models/v1_7/apimachinery/runtime.py +++ b/k8s/models/v1_7/apimachinery/runtime.py @@ -5,7 +5,15 @@ import six from k8s.base import Model -from k8s.fields import Field +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class RawExtension(Model): @@ -54,5 +62,5 @@ class RawExtension(Model): runtime.Unknown object will be created and stored.) """ - Raw = Field(six.text_type) + Raw = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/apimachinery/version.py b/k8s/models/v1_7/apimachinery/version.py index c3457cb..522b6b7 100644 --- a/k8s/models/v1_7/apimachinery/version.py +++ b/k8s/models/v1_7/apimachinery/version.py @@ -5,7 +5,15 @@ import six from k8s.base import Model -from k8s.fields import Field +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class Info(Model): @@ -14,13 +22,13 @@ class Info(Model): information. """ - buildDate = Field(six.text_type) - compiler = Field(six.text_type) - gitCommit = Field(six.text_type) - gitTreeState = Field(six.text_type) - gitVersion = Field(six.text_type) - goVersion = Field(six.text_type) - major = Field(six.text_type) - minor = Field(six.text_type) - platform = Field(six.text_type) + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py index c84ff43..1c78dbf 100644 --- a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py @@ -7,10 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class APIServiceCondition(Model): """ @@ -19,8 +27,8 @@ class APIServiceCondition(Model): lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class APIServiceStatus(Model): @@ -47,13 +55,13 @@ class APIServiceSpec(Model): verification. """ - caBundle = Field(six.text_type) + caBundle = RequiredField(six.text_type) group = Field(six.text_type) - groupPriorityMinimum = Field(int) + groupPriorityMinimum = RequiredField(int) insecureSkipTLSVerify = Field(bool) - service = Field(ServiceReference) + service = RequiredField(ServiceReference) version = Field(six.text_type) - versionPriority = Field(int) + versionPriority = RequiredField(int) class APIService(Model): diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py index dcd3fca..d12056e 100644 --- a/k8s/models/v1_7/kubernetes/api/v1.py +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -7,419 +7,387 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta -class ContainerStateTerminated(Model): - """ - ContainerStateTerminated is a terminated state of a container. - """ - - containerID = Field(six.text_type) - exitCode = Field(int) - finishedAt = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - signal = Field(int) - startedAt = Field(datetime.datetime) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### -class HTTPHeader(Model): +class ObjectFieldSelector(Model): """ - HTTPHeader describes a custom header to be used in HTTP probes + ObjectFieldSelector selects an APIVersioned field of an object. """ - name = Field(six.text_type) - value = Field(six.text_type) + fieldPath = RequiredField(six.text_type) -class HTTPGetAction(Model): +class LoadBalancerIngress(Model): """ - HTTPGetAction describes an action based on HTTP Get requests. + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. """ - host = Field(six.text_type) - httpHeaders = ListField(HTTPHeader) - path = Field(six.text_type) - port = Field(six.text_type, alt_type=int) - scheme = Field(six.text_type) + hostname = Field(six.text_type) + ip = Field(six.text_type) -class PodAffinityTerm(Model): +class LoadBalancerStatus(Model): """ - Defines a set of pods (namely those matching the labelSelector relative to the - given namespace(s)) that this pod should be co-located (affinity) or not co- - located (anti-affinity) with, where co-located is defined as running on a node - whose value of the label with key tches that of any node on which - a pod of the set of pods is running + LoadBalancerStatus represents the status of a load-balancer. """ - labelSelector = Field(LabelSelector) - namespaces = ListField(six.text_type) - topologyKey = Field(six.text_type) + ingress = ListField(LoadBalancerIngress) -class WeightedPodAffinityTerm(Model): +class ServiceStatus(Model): """ - The weights of all of the matched WeightedPodAffinityTerm fields are added per- - node to find the most preferred node(s) + ServiceStatus represents the current status of a service. """ - podAffinityTerm = Field(PodAffinityTerm) - weight = Field(int) + loadBalancer = Field(LoadBalancerStatus) -class PodAffinity(Model): +class HTTPHeader(Model): """ - Pod affinity is a group of inter pod affinity scheduling rules. + HTTPHeader describes a custom header to be used in HTTP probes """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) -class PodAntiAffinity(Model): +class HTTPGetAction(Model): """ - Pod anti affinity is a group of inter pod anti affinity scheduling rules. + HTTPGetAction describes an action based on HTTP Get requests. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) -class PersistentVolumeClaimVolumeSource(Model): +class ContainerStateWaiting(Model): """ - PersistentVolumeClaimVolumeSource references the user's PVC in the same - namespace. This volume finds the bound PV and mounts that volume for the pod. A - PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another - type of volume that is owned by someone else (the system). + ContainerStateWaiting is a waiting state of a container. """ - claimName = Field(six.text_type) - readOnly = Field(bool) + message = Field(six.text_type) + reason = Field(six.text_type) -class DaemonEndpoint(Model): +class LocalObjectReference(Model): """ - DaemonEndpoint contains information about a single Daemon endpoint. + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. """ - Port = Field(int) + name = Field(six.text_type) -class NodeDaemonEndpoints(Model): +class ISCSIVolumeSource(Model): """ - NodeDaemonEndpoints lists ports opened by daemons running on the Node. + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. """ - kubeletEndpoint = Field(DaemonEndpoint) + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) -class ResourceQuotaSpec(Model): +class ScaleIOVolumeSource(Model): """ - ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + ScaleIOVolumeSource represents a persistent ScaleIO volume """ - hard = Field(dict) - scopes = ListField(six.text_type) + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) -class ContainerStateRunning(Model): +class CephFSVolumeSource(Model): """ - ContainerStateRunning is a running state of a container. + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. """ - startedAt = Field(datetime.datetime) + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class CinderVolumeSource(Model): +class FlexVolumeSource(Model): """ - Represents a cinder volume resource in Openstack. A Cinder volume must exist - before mounting to a container. The volume must also be in the same region as - the kubelet. Cinder volumes support ownership management and SELinux - relabeling. + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. """ + driver = RequiredField(six.text_type) fsType = Field(six.text_type) + options = Field(dict) readOnly = Field(bool) - volumeID = Field(six.text_type) + secretRef = Field(LocalObjectReference) -class LocalVolumeSource(Model): +class StorageOSVolumeSource(Model): """ - Local represents directly-attached storage with node affinity + Represents a StorageOS persistent volume resource. """ - path = Field(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) -class FCVolumeSource(Model): +class RBDVolumeSource(Model): """ - Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as - read/write once. Fibre Channel volumes support ownership management and SELinux - relabeling. + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. """ fsType = Field(six.text_type) - lun = Field(int) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) readOnly = Field(bool) - targetWWNs = ListField(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class NodeSelectorRequirement(Model): +class Taint(Model): """ - A node selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. """ - key = Field(six.text_type) - operator = Field(six.text_type) - values = ListField(six.text_type) + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) -class NodeSelectorTerm(Model): +class NodeSpec(Model): """ - A null or empty node selector term matches no objects. + NodeSpec describes the attributes that a node is created with. """ - matchExpressions = ListField(NodeSelectorRequirement) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) -class PreferredSchedulingTerm(Model): +class PortworxVolumeSource(Model): """ - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. - is also a no-op). + PortworxVolumeSource represents a Portworx volume resource. """ - preference = Field(NodeSelectorTerm) - weight = Field(int) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class NodeSelector(Model): +class ResourceQuotaStatus(Model): """ - A node selector represents the union of the results of one or more label - queries over a set of nodes; that is, it represents the OR of the selectors - represented by the node selector terms. + ResourceQuotaStatus defines the enforced hard limits and observed use. """ - nodeSelectorTerms = ListField(NodeSelectorTerm) + hard = Field(dict) + used = Field(dict) -class NodeAffinity(Model): +class QuobyteVolumeSource(Model): """ - Node affinity is a group of node affinity scheduling rules. + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) - requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) -class Affinity(Model): +class AttachedVolume(Model): """ - Affinity is a group of affinity scheduling rules. + AttachedVolume describes a volume attached to a node """ - nodeAffinity = Field(NodeAffinity) - podAffinity = Field(PodAffinity) - podAntiAffinity = Field(PodAntiAffinity) + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) -class NamespaceStatus(Model): +class ContainerImage(Model): """ - NamespaceStatus is information about the current status of a Namespace. + Describe a container image """ - phase = Field(six.text_type) + names = ListField(six.text_type) + sizeBytes = Field(int) -class ExecAction(Model): +class EndpointPort(Model): """ - ExecAction describes a 'run in container' action. + EndpointPort is a tuple that describes a single port. """ - command = ListField(six.text_type) + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) -class ReplicationControllerCondition(Model): +class PersistentVolumeStatus(Model): """ - ReplicationControllerCondition describes the state of a replication controller - at a certain point. + PersistentVolumeStatus is the current status of a persistent volume. """ - lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) + phase = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) -class ReplicationControllerStatus(Model): +class ResourceQuotaSpec(Model): """ - ReplicationControllerStatus represents the current status of a replication - controller. + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. """ - availableReplicas = Field(int) - conditions = ListField(ReplicationControllerCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = Field(int) + hard = Field(dict) + scopes = ListField(six.text_type) -class NodeAddress(Model): +class ResourceQuota(Model): """ - NodeAddress contains information for the node's address. + ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") - address = Field(six.text_type) - type = Field(six.text_type) - - -class PortworxVolumeSource(Model): - """ - PortworxVolumeSource represents a Portworx volume resource. - """ - - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = Field(six.text_type) - - -class NodeCondition(Model): - """ - NodeCondition contains condition information for a node. - """ - - lastHeartbeatTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) - - -class ResourceRequirements(Model): - """ - ResourceRequirements describes the compute resource requirements. - """ - - limits = Field(dict) - requests = Field(dict) - - -class PersistentVolumeClaimSpec(Model): - """ - PersistentVolumeClaimSpec describes the common attributes of storage devices - and allows a Source for provider-specific attributes - """ - - accessModes = ListField(six.text_type) - resources = Field(ResourceRequirements) - selector = Field(LabelSelector) - storageClassName = Field(six.text_type) - volumeName = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) -class LocalObjectReference(Model): +class ResourceQuotaList(Model): """ - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + ResourceQuotaList is a list of ResourceQuota items. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") - name = Field(six.text_type) + items = ListField(ResourceQuota) + metadata = Field(ListMeta) -class FlexVolumeSource(Model): +class VsphereVirtualDiskVolumeSource(Model): """ - FlexVolume represents a generic volume resource that is provisioned/attached - using an exec based plugin. This is an alpha feature and may change in future. + Represents a vSphere volume resource. """ - driver = Field(six.text_type) fsType = Field(six.text_type) - options = Field(dict) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) -class ScaleIOVolumeSource(Model): +class ComponentCondition(Model): """ - ScaleIOVolumeSource represents a persistent ScaleIO volume + Information about the condition of a component. """ - fsType = Field(six.text_type) - gateway = Field(six.text_type) - protectionDomain = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - sslEnabled = Field(bool) - storageMode = Field(six.text_type) - storagePool = Field(six.text_type) - system = Field(six.text_type) - volumeName = Field(six.text_type) + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class RBDVolumeSource(Model): +class ComponentStatus(Model): """ - Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD - volumes support ownership management and SELinux relabeling. + ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") - fsType = Field(six.text_type) - image = Field(six.text_type) - keyring = Field(six.text_type) - monitors = ListField(six.text_type) - pool = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) -class ISCSIVolumeSource(Model): +class ComponentStatusList(Model): """ - Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. - ISCSI volumes support ownership management and SELinux relabeling. + Status of all the conditions for the component as a list of ComponentStatus + objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") - chapAuthDiscovery = Field(bool) - chapAuthSession = Field(bool) - fsType = Field(six.text_type) - iqn = Field(six.text_type) - iscsiInterface = Field(six.text_type) - lun = Field(int) - portals = ListField(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - targetPortal = Field(six.text_type) + items = ListField(ComponentStatus) + metadata = Field(ListMeta) -class CephFSVolumeSource(Model): +class ExecAction(Model): """ - Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs - volumes do not support ownership management or SELinux relabeling. + ExecAction describes a 'run in container' action. """ - monitors = ListField(six.text_type) - path = Field(six.text_type) - readOnly = Field(bool) - secretFile = Field(six.text_type) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + command = ListField(six.text_type) -class StorageOSVolumeSource(Model): +class ContainerStateTerminated(Model): """ - Represents a StorageOS persistent volume resource. + ContainerStateTerminated is a terminated state of a container. """ - fsType = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - volumeName = Field(six.text_type) - volumeNamespace = Field(six.text_type) + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) class ObjectReference(Model): @@ -435,45 +403,6 @@ class ObjectReference(Model): uid = Field(six.text_type) -class StorageOSPersistentVolumeSource(Model): - """ - Represents a StorageOS persistent volume resource. - """ - - fsType = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(ObjectReference) - volumeName = Field(six.text_type) - volumeNamespace = Field(six.text_type) - - -class Binding(Model): - """ - Binding ties one object to another; for example, a pod is bound to a node by a - scheduler. Deprecated in 1.7, please use the bindings subresource of pods - instead. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Binding") - - metadata = Field(ObjectMeta) - target = Field(ObjectReference) - - -class EndpointAddress(Model): - """ - EndpointAddress is a tuple that describes single IP address. - """ - - hostname = Field(six.text_type) - ip = Field(six.text_type) - nodeName = Field(six.text_type) - targetRef = Field(ObjectReference) - - class ServiceAccount(Model): """ ServiceAccount binds together: * a name, understood by users, and perhaps by @@ -511,129 +440,113 @@ class ServiceAccountList(Model): metadata = Field(ListMeta) -class PhotonPersistentDiskVolumeSource(Model): +class Binding(Model): """ - Represents a Photon Controller persistent disk resource. + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") - fsType = Field(six.text_type) - pdID = Field(six.text_type) + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) -class Toleration(Model): +class EndpointAddress(Model): """ - The pod this Toleration is attached to tolerates any taint that matches the - triple using the matching operator . + EndpointAddress is a tuple that describes single IP address. """ - effect = Field(six.text_type) - key = Field(six.text_type) - operator = Field(six.text_type) - tolerationSeconds = Field(int) - value = Field(six.text_type) + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) -class SecretKeySelector(Model): +class EndpointSubset(Model): """ - SecretKeySelector selects a key of a Secret. + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] """ - key = Field(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) -class ResourceFieldSelector(Model): +class Endpoints(Model): """ - ResourceFieldSelector represents container resources (cpu, memory) and their - output format - """ - - containerName = Field(six.text_type) - divisor = Field(six.text_type) - resource = Field(six.text_type) - - -class ContainerImage(Model): - """ - Describe a container image - """ - - names = ListField(six.text_type) - sizeBytes = Field(int) - - -class KeyToPath(Model): - """ - Maps a string key to a path within a volume. - """ - - key = Field(six.text_type) - mode = Field(int) - path = Field(six.text_type) - - -class ConfigMapVolumeSource(Model): - """ - Adapts a ConfigMap into a volume. - - The contents of the target ConfigMap's Data - field will be presented in a volume as files using the keys in the Data field - as the file names, unless the items element is populated with specific mappings - of keys to paths. ConfigMap volumes support ownership management and SELinux - relabeling. - """ - - defaultMode = Field(int) - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) - - -class ConfigMapProjection(Model): - """ - Adapts a ConfigMap into a projected volume. - - The contents of the target - ConfigMap's Data field will be presented in a projected volume as files using - the keys in the Data field as the file names, unless the items element is - populated with specific mappings of keys to paths. Note that this is identical - to a configmap volume source without the default mode. + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) -class SecretVolumeSource(Model): +class EndpointsList(Model): """ - Adapts a Secret into a volume. - - The contents of the target Secret's Data field - will be presented in a volume as files using the keys in the Data field as the - file names. Secret volumes support ownership management and SELinux relabeling. + EndpointsList is a list of endpoints. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") - defaultMode = Field(int) - items = ListField(KeyToPath) - optional = Field(bool) - secretName = Field(six.text_type) + items = ListField(Endpoints) + metadata = Field(ListMeta) -class SecretProjection(Model): +class StorageOSPersistentVolumeSource(Model): """ - Adapts a secret into a projected volume. - - The contents of the target Secret's - Data field will be presented in a projected volume as files using the keys in - the Data field as the file names. Note that this is identical to a secret - volume source without the default mode. + Represents a StorageOS persistent volume resource. """ - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) class TCPSocketAction(Model): @@ -642,7 +555,7 @@ class TCPSocketAction(Model): """ host = Field(six.text_type) - port = Field(six.text_type, alt_type=int) + port = RequiredField(six.text_type, alt_type=int) class Handler(Model): @@ -683,161 +596,244 @@ class Probe(Model): timeoutSeconds = Field(int) -class ContainerPort(Model): +class NamespaceStatus(Model): """ - ContainerPort represents a network port in a single container. + NamespaceStatus is information about the current status of a Namespace. """ - containerPort = Field(int) - hostIP = Field(six.text_type) - hostPort = Field(int) - name = Field(six.text_type) - protocol = Field(six.text_type) + phase = Field(six.text_type) -class ContainerStateWaiting(Model): +class FCVolumeSource(Model): """ - ContainerStateWaiting is a waiting state of a container. + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. """ - message = Field(six.text_type) - reason = Field(six.text_type) + fsType = Field(six.text_type) + lun = RequiredField(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) -class ContainerState(Model): +class CinderVolumeSource(Model): """ - ContainerState holds a possible state of container. Only one of its members may - be specified. If none of them is specified, the default one is - ContainerStateWaiting. + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. """ - running = Field(ContainerStateRunning) - terminated = Field(ContainerStateTerminated) - waiting = Field(ContainerStateWaiting) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class ContainerStatus(Model): +class HostPathVolumeSource(Model): """ - ContainerStatus contains details for the current status of this container. + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. """ - containerID = Field(six.text_type) - image = Field(six.text_type) - imageID = Field(six.text_type) - lastState = Field(ContainerState) - name = Field(six.text_type) - ready = Field(bool) - restartCount = Field(int) - state = Field(ContainerState) + path = RequiredField(six.text_type) -class VsphereVirtualDiskVolumeSource(Model): +class FlockerVolumeSource(Model): """ - Represents a vSphere volume resource. + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. """ - fsType = Field(six.text_type) - storagePolicyID = Field(six.text_type) - storagePolicyName = Field(six.text_type) - volumePath = Field(six.text_type) + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) -class NamespaceSpec(Model): +class ReplicationControllerCondition(Model): """ - NamespaceSpec describes the attributes on a Namespace. + ReplicationControllerCondition describes the state of a replication controller + at a certain point. """ - finalizers = ListField(six.text_type) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class Namespace(Model): +class ReplicationControllerStatus(Model): """ - Namespace provides a scope for Names. Use of multiple namespaces is optional. + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. """ class Meta: - create_url = "/api/v1/namespaces" - delete_url = "/api/v1/namespaces/{name}" - get_url = "/api/v1/namespaces/{name}" - list_all_url = "/api/v1/namespaces" - update_url = "/api/v1/namespaces/{name}/finalize" - update_url = "/api/v1/namespaces/{name}" - watch_url = "/api/v1/watch/namespaces/{name}" - watchlist_all_url = "/api/v1/watch/namespaces" + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Namespace") + kind = Field(six.text_type, "Secret") + data = Field(dict) metadata = Field(ObjectMeta) - spec = Field(NamespaceSpec) - status = Field(NamespaceStatus) + stringData = Field(dict) + type = Field(six.text_type) -class NamespaceList(Model): +class SecretList(Model): """ - NamespaceList is a list of Namespaces. + SecretList is a list of Secret. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NamespaceList") + kind = Field(six.text_type, "SecretList") - items = ListField(Namespace) + items = ListField(Secret) metadata = Field(ListMeta) -class VolumeMount(Model): +class LimitRangeItem(Model): """ - VolumeMount describes a mounting of a Volume within a container. + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. """ - mountPath = Field(six.text_type) - name = Field(six.text_type) - readOnly = Field(bool) - subPath = Field(six.text_type) + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) -class NFSVolumeSource(Model): +class LimitRangeSpec(Model): """ - Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not - support ownership management or SELinux relabeling. + LimitRangeSpec defines a min/max usage limit for resources that match on kind. """ - path = Field(six.text_type) - readOnly = Field(bool) - server = Field(six.text_type) + limits = ListField(LimitRangeItem) -class ConfigMap(Model): +class LimitRange(Model): """ - ConfigMap holds configuration data for pods to consume. + LimitRange sets resource usage limits for each kind of resource in a Namespace. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/configmaps" - delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - list_all_url = "/api/v1/configmaps" - list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" - update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" - watchlist_all_url = "/api/v1/watch/configmaps" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMap") + kind = Field(six.text_type, "LimitRange") - data = Field(dict) metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) -class ConfigMapList(Model): +class LimitRangeList(Model): """ - ConfigMapList is a resource containing a list of ConfigMap objects. + LimitRangeList is a list of LimitRange items. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMapList") + kind = Field(six.text_type, "LimitRangeList") - items = ListField(ConfigMap) + items = ListField(LimitRange) metadata = Field(ListMeta) +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity + """ + + path = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) + + class EventSource(Model): """ EventSource contains information for an event. @@ -867,10 +863,10 @@ class Meta: count = Field(int) firstTimestamp = Field(datetime.datetime) - involvedObject = Field(ObjectReference) + involvedObject = RequiredField(ObjectReference) lastTimestamp = Field(datetime.datetime) message = Field(six.text_type) - metadata = Field(ObjectMeta) + metadata = RequiredField(ObjectMeta) reason = Field(six.text_type) source = Field(EventSource) type = Field(six.text_type) @@ -887,739 +883,679 @@ class EventList(Model): metadata = Field(ListMeta) -class ConfigMapKeySelector(Model): +class AzureFileVolumeSource(Model): """ - Selects a key from a ConfigMap. + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. """ - key = Field(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) -class SELinuxOptions(Model): +class NodeCondition(Model): """ - SELinuxOptions are the labels to be applied to the container + NodeCondition contains condition information for a node. """ - level = Field(six.text_type) - role = Field(six.text_type) - type = Field(six.text_type) - user = Field(six.text_type) + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class PodSecurityContext(Model): +class PhotonPersistentDiskVolumeSource(Model): """ - PodSecurityContext holds pod-level security attributes and common container - settings. Some fields are also present in container.securityContext. Field - values of container.securityContext take precedence over field values of - PodSecurityContext. + Represents a Photon Controller persistent disk resource. """ - fsGroup = Field(int) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) - supplementalGroups = ListField(int) + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) -class ResourceQuotaStatus(Model): +class EmptyDirVolumeSource(Model): """ - ResourceQuotaStatus defines the enforced hard limits and observed use. + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. """ - hard = Field(dict) - used = Field(dict) + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) -class ResourceQuota(Model): +class HostAlias(Model): """ - ResourceQuota sets aggregate quota restrictions enforced per namespace + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/resourcequotas" - delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - list_all_url = "/api/v1/resourcequotas" - list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" - update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" - watchlist_all_url = "/api/v1/watch/resourcequotas" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ResourceQuota") - metadata = Field(ObjectMeta) - spec = Field(ResourceQuotaSpec) - status = Field(ResourceQuotaStatus) + hostnames = ListField(six.text_type) + ip = Field(six.text_type) -class ResourceQuotaList(Model): +class KeyToPath(Model): """ - ResourceQuotaList is a list of ResourceQuota items. + Maps a string key to a path within a volume. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ResourceQuotaList") - items = ListField(ResourceQuota) - metadata = Field(ListMeta) + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) -class EndpointPort(Model): +class ConfigMapProjection(Model): """ - EndpointPort is a tuple that describes a single port. + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. """ + items = ListField(KeyToPath) name = Field(six.text_type) - port = Field(int) - protocol = Field(six.text_type) + optional = Field(bool) -class EndpointSubset(Model): +class ConfigMapVolumeSource(Model): """ - EndpointSubset is a group of addresses with a common set of ports. The expanded - set of endpoints is the Cartesian product of Addresses x Ports. For example, - given: - { - Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] - } - The - resulting set of endpoints can be viewed as: - a: [ 10.10.1.1:8675, - 10.10.2.2:8675 ], - b: [ 10.10.1.1:309, 10.10.2.2:309 ] + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. """ - addresses = ListField(EndpointAddress) - notReadyAddresses = ListField(EndpointAddress) - ports = ListField(EndpointPort) + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class Endpoints(Model): +class SecretVolumeSource(Model): """ - Endpoints is a collection of endpoints that implement the actual service. - Example: - Name: 'mysvc', - Subsets: [ - { - Addresses: [{'ip': - '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, - {'name': 'b', 'port': 309}] - }, - { - Addresses: [{'ip': - '10.10.3.3'}], - Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': - 76}] - }, - ] + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/endpoints" - delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - list_all_url = "/api/v1/endpoints" - list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" - update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" - watchlist_all_url = "/api/v1/watch/endpoints" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Endpoints") - metadata = Field(ObjectMeta) - subsets = ListField(EndpointSubset) + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) -class EndpointsList(Model): +class SecretProjection(Model): """ - EndpointsList is a list of endpoints. + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EndpointsList") - items = ListField(Endpoints) - metadata = Field(ListMeta) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PodCondition(Model): +class SecretEnvSource(Model): """ - PodCondition contains details for the current condition of this pod. - """ - - lastProbeTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) - - -class PodStatus(Model): - """ - PodStatus represents information about the status of a pod. Status may trail - the actual state of a system. - """ - - conditions = ListField(PodCondition) - containerStatuses = ListField(ContainerStatus) - hostIP = Field(six.text_type) - initContainerStatuses = ListField(ContainerStatus) - message = Field(six.text_type) - phase = Field(six.text_type) - podIP = Field(six.text_type) - qosClass = Field(six.text_type) - reason = Field(six.text_type) - startTime = Field(datetime.datetime) - - -class ConfigMapEnvSource(Model): - """ - ConfigMapEnvSource selects a ConfigMap to populate the environment variables - with. - - The contents of the target ConfigMap's Data field will represent the - key-value pairs as environment variables. + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. """ name = Field(six.text_type) optional = Field(bool) -class GlusterfsVolumeSource(Model): +class VolumeMount(Model): """ - Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs - volumes do not support ownership management or SELinux relabeling. + VolumeMount describes a mounting of a Volume within a container. """ - endpoints = Field(six.text_type) - path = Field(six.text_type) + mountPath = RequiredField(six.text_type) + name = RequiredField(six.text_type) readOnly = Field(bool) + subPath = Field(six.text_type) -class AttachedVolume(Model): - """ - AttachedVolume describes a volume attached to a node +class AWSElasticBlockStoreVolumeSource(Model): """ + Represents a Persistent Disk resource in AWS. - devicePath = Field(six.text_type) - name = Field(six.text_type) - - -class QuobyteVolumeSource(Model): - """ - Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do - not support ownership management or SELinux relabeling. + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. """ - group = Field(six.text_type) + fsType = Field(six.text_type) + partition = Field(int) readOnly = Field(bool) - registry = Field(six.text_type) - user = Field(six.text_type) - volume = Field(six.text_type) + volumeID = RequiredField(six.text_type) -class PersistentVolumeStatus(Model): +class ServicePort(Model): """ - PersistentVolumeStatus is the current status of a persistent volume. + ServicePort contains information on service's port. """ - message = Field(six.text_type) - phase = Field(six.text_type) - reason = Field(six.text_type) + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) -class ComponentCondition(Model): +class ServiceSpec(Model): """ - Information about the condition of a component. + ServiceSpec describes the attributes that a user creates on a service. """ - error = Field(six.text_type) - message = Field(six.text_type) - status = Field(six.text_type) + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + selector = Field(dict) + sessionAffinity = Field(six.text_type) type = Field(six.text_type) -class ComponentStatus(Model): +class Service(Model): """ - ComponentStatus (and ComponentStatusList) holds the cluster validation info. + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. """ class Meta: - get_url = "/api/v1/componentstatuses/{name}" - list_all_url = "/api/v1/componentstatuses" + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatus") + kind = Field(six.text_type, "Service") - conditions = ListField(ComponentCondition) metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) -class ComponentStatusList(Model): +class ServiceList(Model): """ - Status of all the conditions for the component as a list of ComponentStatus - objects. + ServiceList holds a list of services. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatusList") + kind = Field(six.text_type, "ServiceList") - items = ListField(ComponentStatus) + items = ListField(Service) metadata = Field(ListMeta) -class PersistentVolumeClaimStatus(Model): - """ - PersistentVolumeClaimStatus is the current status of a persistent volume claim. - """ - - accessModes = ListField(six.text_type) - capacity = Field(dict) - phase = Field(six.text_type) - - -class PersistentVolumeClaim(Model): +class ConfigMap(Model): """ - PersistentVolumeClaim is a user's request for and claim to a persistent volume + ConfigMap holds configuration data for pods to consume. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - list_all_url = "/api/v1/persistentvolumeclaims" - list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaim") + kind = Field(six.text_type, "ConfigMap") + data = Field(dict) metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeClaimSpec) - status = Field(PersistentVolumeClaimStatus) -class PersistentVolumeClaimList(Model): +class ConfigMapList(Model): """ - PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + ConfigMapList is a resource containing a list of ConfigMap objects. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaimList") + kind = Field(six.text_type, "ConfigMapList") - items = ListField(PersistentVolumeClaim) + items = ListField(ConfigMap) metadata = Field(ListMeta) -class Secret(Model): +class Capabilities(Model): """ - Secret holds secret data of a certain type. The total bytes of the values in - the Data field must be less than MaxSecretSize bytes. + Adds and removes POSIX capabilities from running containers. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/secrets" - delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - list_all_url = "/api/v1/secrets" - list_ns_url = "/api/v1/namespaces/{namespace}/secrets" - update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" - watchlist_all_url = "/api/v1/watch/secrets" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Secret") - data = Field(dict) - metadata = Field(ObjectMeta) - stringData = Field(dict) - type = Field(six.text_type) + add = ListField(six.text_type) + drop = ListField(six.text_type) -class SecretList(Model): +class Toleration(Model): """ - SecretList is a list of Secret. + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "SecretList") - items = ListField(Secret) - metadata = Field(ListMeta) + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) -class HostAlias(Model): +class PodAffinityTerm(Model): """ - HostAlias holds the mapping between IP and hostnames that will be injected as - an entry in the pod's hosts file. + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running """ - hostnames = ListField(six.text_type) - ip = Field(six.text_type) + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) -class AzureDiskVolumeSource(Model): +class WeightedPodAffinityTerm(Model): """ - AzureDisk represents an Azure Data Disk mount on the host and bind mount to the - pod. + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) """ - cachingMode = Field(six.text_type) - diskName = Field(six.text_type) - diskURI = Field(six.text_type) - fsType = Field(six.text_type) - readOnly = Field(bool) + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) -class ObjectFieldSelector(Model): +class PodAffinity(Model): """ - ObjectFieldSelector selects an APIVersioned field of an object. + Pod affinity is a group of inter pod affinity scheduling rules. """ - fieldPath = Field(six.text_type) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class DownwardAPIVolumeFile(Model): +class PodAntiAffinity(Model): """ - DownwardAPIVolumeFile represents information to create the file containing the - pod field + Pod anti affinity is a group of inter pod anti affinity scheduling rules. """ - fieldRef = Field(ObjectFieldSelector) - mode = Field(int) - path = Field(six.text_type) - resourceFieldRef = Field(ResourceFieldSelector) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class DownwardAPIVolumeSource(Model): +class DaemonEndpoint(Model): """ - DownwardAPIVolumeSource represents a volume containing downward API info. - Downward API volumes support ownership management and SELinux relabeling. + DaemonEndpoint contains information about a single Daemon endpoint. """ - defaultMode = Field(int) - items = ListField(DownwardAPIVolumeFile) + Port = RequiredField(int) -class DownwardAPIProjection(Model): +class NodeDaemonEndpoints(Model): """ - Represents downward API info for projecting into a projected volume. Note that - this is identical to a downwardAPI volume source without the default mode. + NodeDaemonEndpoints lists ports opened by daemons running on the Node. """ - items = ListField(DownwardAPIVolumeFile) + kubeletEndpoint = Field(DaemonEndpoint) -class VolumeProjection(Model): +class PodCondition(Model): """ - Projection that may be projected along with other supported volume types + PodCondition contains details for the current condition of this pod. """ - configMap = Field(ConfigMapProjection) - downwardAPI = Field(DownwardAPIProjection) - secret = Field(SecretProjection) + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class ProjectedVolumeSource(Model): +class PersistentVolumeClaimVolumeSource(Model): """ - Represents a projected volume source + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). """ - defaultMode = Field(int) - sources = ListField(VolumeProjection) + claimName = RequiredField(six.text_type) + readOnly = Field(bool) -class EnvVarSource(Model): +class ConfigMapEnvSource(Model): """ - EnvVarSource represents a source for the value of an EnvVar. + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. """ - configMapKeyRef = Field(ConfigMapKeySelector) - fieldRef = Field(ObjectFieldSelector) - resourceFieldRef = Field(ResourceFieldSelector) - secretKeyRef = Field(SecretKeySelector) + name = Field(six.text_type) + optional = Field(bool) -class EnvVar(Model): +class EnvFromSource(Model): """ - EnvVar represents an environment variable present in a Container. + EnvFromSource represents the source of a set of ConfigMaps """ + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) name = Field(six.text_type) - value = Field(six.text_type) - valueFrom = Field(EnvVarSource) + optional = Field(bool) -class LimitRangeItem(Model): +class NodeSelectorRequirement(Model): """ - LimitRangeItem defines a min/max usage limit for any resource that matches on - kind. + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - default = Field(dict) - defaultRequest = Field(dict) - max = Field(dict) - maxLimitRequestRatio = Field(dict) - min = Field(dict) - type = Field(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class LimitRangeSpec(Model): +class NodeSelectorTerm(Model): """ - LimitRangeSpec defines a min/max usage limit for resources that match on kind. + A null or empty node selector term matches no objects. """ - limits = ListField(LimitRangeItem) + matchExpressions = ListField(NodeSelectorRequirement) -class LimitRange(Model): +class PreferredSchedulingTerm(Model): """ - LimitRange sets resource usage limits for each kind of resource in a Namespace. + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/limitranges" - delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - list_all_url = "/api/v1/limitranges" - list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" - update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" - watchlist_all_url = "/api/v1/watch/limitranges" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRange") - metadata = Field(ObjectMeta) - spec = Field(LimitRangeSpec) + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) -class LimitRangeList(Model): +class NodeSelector(Model): """ - LimitRangeList is a list of LimitRange items. + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRangeList") - items = ListField(LimitRange) - metadata = Field(ListMeta) + nodeSelectorTerms = ListField(NodeSelectorTerm) -class EmptyDirVolumeSource(Model): +class NodeAffinity(Model): """ - Represents an empty directory for a pod. Empty directory volumes support - ownership management and SELinux relabeling. + Node affinity is a group of node affinity scheduling rules. """ - medium = Field(six.text_type) - sizeLimit = Field(six.text_type) + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) -class FlockerVolumeSource(Model): +class Affinity(Model): """ - Represents a Flocker volume mounted by the Flocker agent. One and only one of - datasetName and datasetUUID should be set. Flocker volumes do not support - ownership management or SELinux relabeling. + Affinity is a group of affinity scheduling rules. """ - datasetName = Field(six.text_type) - datasetUUID = Field(six.text_type) + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) -class SecretEnvSource(Model): +class NodeSystemInfo(Model): """ - SecretEnvSource selects a Secret to populate the environment variables with. - The contents of the target Secret's Data field will represent the key-value - pairs as environment variables. + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. """ - name = Field(six.text_type) - optional = Field(bool) + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) -class EnvFromSource(Model): +class NodeStatus(Model): """ - EnvFromSource represents the source of a set of ConfigMaps + NodeStatus is information about the current status of a node. """ - configMapRef = Field(ConfigMapEnvSource) - prefix = Field(six.text_type) - secretRef = Field(SecretEnvSource) + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) -class LoadBalancerIngress(Model): +class Node(Model): """ - LoadBalancerIngress represents the status of a load-balancer ingress point: - traffic intended for the service should be sent to an ingress point. + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") - hostname = Field(six.text_type) - ip = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) -class LoadBalancerStatus(Model): +class NodeList(Model): """ - LoadBalancerStatus represents the status of a load-balancer. + NodeList is the whole list of all Nodes which have been registered with master. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") - ingress = ListField(LoadBalancerIngress) + items = ListField(Node) + metadata = Field(ListMeta) -class ServiceStatus(Model): +class NamespaceSpec(Model): """ - ServiceStatus represents the current status of a service. + NamespaceSpec describes the attributes on a Namespace. """ - loadBalancer = Field(LoadBalancerStatus) + finalizers = ListField(six.text_type) -class AWSElasticBlockStoreVolumeSource(Model): +class Namespace(Model): """ - Represents a Persistent Disk resource in AWS. + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}/finalize" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") - An AWS EBS disk must exist - before mounting to a container. The disk must also be in the same AWS zone as - the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS - volumes support ownership management and SELinux relabeling. + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. """ + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) - partition = Field(int) readOnly = Field(bool) - volumeID = Field(six.text_type) -class Capabilities(Model): +class ResourceFieldSelector(Model): """ - Adds and removes POSIX capabilities from running containers. + ResourceFieldSelector represents container resources (cpu, memory) and their + output format """ - add = ListField(six.text_type) - drop = ListField(six.text_type) + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) -class SecurityContext(Model): +class EnvVarSource(Model): """ - SecurityContext holds security configuration that will be applied to a - container. Some fields are present in both SecurityContext and - PodSecurityContext. When both are set, the values in SecurityContext take - precedence. + EnvVarSource represents a source for the value of an EnvVar. """ - capabilities = Field(Capabilities) - privileged = Field(bool) - readOnlyRootFilesystem = Field(bool) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) -class Container(Model): +class EnvVar(Model): """ - A single application container that you want to run within a pod. + EnvVar represents an environment variable present in a Container. """ - args = ListField(six.text_type) - command = ListField(six.text_type) - env = ListField(EnvVar) - envFrom = ListField(EnvFromSource) - image = Field(six.text_type) - imagePullPolicy = Field(six.text_type) - lifecycle = Field(Lifecycle) - livenessProbe = Field(Probe) - name = Field(six.text_type) - ports = ListField(ContainerPort) - readinessProbe = Field(Probe) - resources = Field(ResourceRequirements) - securityContext = Field(SecurityContext) - stdin = Field(bool) - stdinOnce = Field(bool) - terminationMessagePath = Field(six.text_type) - terminationMessagePolicy = Field(six.text_type) - tty = Field(bool) - volumeMounts = ListField(VolumeMount) - workingDir = Field(six.text_type) + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) -class ServicePort(Model): +class DownwardAPIVolumeFile(Model): """ - ServicePort contains information on service's port. + DownwardAPIVolumeFile represents information to create the file containing the + pod field """ - name = Field(six.text_type) - nodePort = Field(int) - port = Field(int) - protocol = Field(six.text_type) - targetPort = Field(six.text_type, alt_type=int) + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) -class ServiceSpec(Model): +class DownwardAPIProjection(Model): """ - ServiceSpec describes the attributes that a user creates on a service. + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. """ - clusterIP = Field(six.text_type) - externalIPs = ListField(six.text_type) - externalName = Field(six.text_type) - externalTrafficPolicy = Field(six.text_type) - healthCheckNodePort = Field(int) - loadBalancerIP = Field(six.text_type) - loadBalancerSourceRanges = ListField(six.text_type) - ports = ListField(ServicePort) - selector = Field(dict) - sessionAffinity = Field(six.text_type) - type = Field(six.text_type) + items = ListField(DownwardAPIVolumeFile) -class Service(Model): +class VolumeProjection(Model): """ - Service is a named abstraction of software service (for example, mysql) - consisting of local port (for example 3306) that the proxy listens on, and the - selector that determines which pods will answer requests sent through the - proxy. + Projection that may be projected along with other supported volume types """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/services" - delete_url = "/api/v1/namespaces/{namespace}/services/{name}" - get_url = "/api/v1/namespaces/{namespace}/services/{name}" - list_all_url = "/api/v1/services" - list_ns_url = "/api/v1/namespaces/{namespace}/services" - update_url = "/api/v1/namespaces/{namespace}/services/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" - watchlist_all_url = "/api/v1/watch/services" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Service") - metadata = Field(ObjectMeta) - spec = Field(ServiceSpec) - status = Field(ServiceStatus) + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) -class ServiceList(Model): +class ProjectedVolumeSource(Model): """ - ServiceList holds a list of services. + Represents a projected volume source """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceList") - items = ListField(Service) - metadata = Field(ListMeta) + defaultMode = Field(int) + sources = ListField(VolumeProjection) -class AzureFileVolumeSource(Model): +class DownwardAPIVolumeSource(Model): """ - AzureFile represents an Azure File Service mount on the host and bind mount to - the pod. + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. """ - readOnly = Field(bool) - secretName = Field(six.text_type) - shareName = Field(six.text_type) + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) class GitRepoVolumeSource(Model): @@ -1630,125 +1566,150 @@ class GitRepoVolumeSource(Model): """ directory = Field(six.text_type) - repository = Field(six.text_type) + repository = RequiredField(six.text_type) revision = Field(six.text_type) -class NodeSystemInfo(Model): +class SELinuxOptions(Model): """ - NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + SELinuxOptions are the labels to be applied to the container """ - architecture = Field(six.text_type) - bootID = Field(six.text_type) - containerRuntimeVersion = Field(six.text_type) - kernelVersion = Field(six.text_type) - kubeProxyVersion = Field(six.text_type) - kubeletVersion = Field(six.text_type) - machineID = Field(six.text_type) - operatingSystem = Field(six.text_type) - osImage = Field(six.text_type) - systemUUID = Field(six.text_type) + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) -class NodeStatus(Model): +class PodSecurityContext(Model): """ - NodeStatus is information about the current status of a node. + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. """ - addresses = ListField(NodeAddress) - allocatable = Field(dict) - capacity = Field(dict) - conditions = ListField(NodeCondition) - daemonEndpoints = Field(NodeDaemonEndpoints) - images = ListField(ContainerImage) - nodeInfo = Field(NodeSystemInfo) - phase = Field(six.text_type) - volumesAttached = ListField(AttachedVolume) - volumesInUse = ListField(six.text_type) + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) -class Taint(Model): +class SecurityContext(Model): """ - The node this Taint is attached to has the effect 'effect' on any pod that that - does not tolerate the Taint. + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. """ - effect = Field(six.text_type) - key = Field(six.text_type) - timeAdded = Field(datetime.datetime) - value = Field(six.text_type) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) -class NodeSpec(Model): +class ContainerStateRunning(Model): """ - NodeSpec describes the attributes that a node is created with. + ContainerStateRunning is a running state of a container. """ - externalID = Field(six.text_type) - podCIDR = Field(six.text_type) - providerID = Field(six.text_type) - taints = ListField(Taint) - unschedulable = Field(bool) + startedAt = Field(datetime.datetime) -class Node(Model): - """ - Node is a worker node in Kubernetes. Each node will have a unique identifier in - the cache (i.e. in etcd). +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. """ - class Meta: - create_url = "/api/v1/nodes" - delete_url = "/api/v1/nodes/{name}" - get_url = "/api/v1/nodes/{name}" - list_all_url = "/api/v1/nodes" - update_url = "/api/v1/nodes/{name}" - watch_url = "/api/v1/watch/nodes/{name}" - watchlist_all_url = "/api/v1/watch/nodes" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Node") - metadata = Field(ObjectMeta) - spec = Field(NodeSpec) - status = Field(NodeStatus) + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) -class NodeList(Model): +class ContainerStatus(Model): """ - NodeList is the whole list of all Nodes which have been registered with master. + ContainerStatus contains details for the current status of this container. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NodeList") - items = ListField(Node) - metadata = Field(ListMeta) + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) -class HostPathVolumeSource(Model): +class PodStatus(Model): """ - Represents a host path mapped into a pod. Host path volumes do not support - ownership management or SELinux relabeling. + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. """ - path = Field(six.text_type) + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) -class GCEPersistentDiskVolumeSource(Model): +class NFSVolumeSource(Model): """ - Represents a Persistent Disk resource in Google Compute Engine. - - A GCE PD must - exist before mounting to a container. The disk must also be in the same GCE - project and zone as the kubelet. A GCE PD can only be mounted as read/write - once or read-only many times. GCE PDs support ownership management and SELinux - relabeling. + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. """ - fsType = Field(six.text_type) - partition = Field(int) - pdName = Field(six.text_type) + path = RequiredField(six.text_type) readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) class PersistentVolumeSpec(Model): @@ -1804,7 +1765,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(PersistentVolumeSpec) - status = Field(PersistentVolumeStatus) + status = ReadOnlyField(PersistentVolumeStatus) class PersistentVolumeList(Model): @@ -1818,40 +1779,87 @@ class PersistentVolumeList(Model): metadata = Field(ListMeta) -class Volume(Model): +class ResourceRequirements(Model): """ - Volume represents a named volume in a pod that may be accessed by any container - in the pod. + ResourceRequirements describes the compute resource requirements. """ - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - configMap = Field(ConfigMapVolumeSource) - downwardAPI = Field(DownwardAPIVolumeSource) - emptyDir = Field(EmptyDirVolumeSource) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - gitRepo = Field(GitRepoVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - name = Field(six.text_type) - nfs = Field(NFSVolumeSource) - persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - projected = Field(ProjectedVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - secret = Field(SecretVolumeSource) - storageos = Field(StorageOSVolumeSource) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = RequiredField(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) class PodSpec(Model): @@ -1884,6 +1892,41 @@ class PodSpec(Model): volumes = ListField(Volume) +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + class PodTemplateSpec(Model): """ PodTemplateSpec describes the data a pod should have when created from a @@ -1925,7 +1968,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(ReplicationControllerSpec) - status = Field(ReplicationControllerStatus) + status = ReadOnlyField(ReplicationControllerStatus) class ReplicationControllerList(Model): @@ -1971,38 +2014,3 @@ class PodTemplateList(Model): items = ListField(PodTemplate) metadata = Field(ListMeta) - -class Pod(Model): - """ - Pod is a collection of containers that can run on a host. This resource is - created by clients and scheduled onto hosts. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods" - delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" - get_url = "/api/v1/namespaces/{namespace}/pods/{name}" - list_all_url = "/api/v1/pods" - list_ns_url = "/api/v1/namespaces/{namespace}/pods" - update_url = "/api/v1/namespaces/{namespace}/pods/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" - watchlist_all_url = "/api/v1/watch/pods" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Pod") - - metadata = Field(ObjectMeta) - spec = Field(PodSpec) - status = Field(PodStatus) - - -class PodList(Model): - """ - PodList is a list of Pods. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PodList") - - items = ListField(Pod) - metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py index 9a272a2..a58cb3c 100644 --- a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py @@ -5,20 +5,16 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta -class RuleWithOperations(Model): - """ - RuleWithOperations is a tuple of Operations and Resources. It is recommended to - make sure that all the tuple expansions are valid. - """ - - apiGroups = ListField(six.text_type) - apiVersions = ListField(six.text_type) - operations = ListField(six.text_type) - resources = ListField(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class Rule(Model): @@ -39,7 +35,7 @@ class Initializer(Model): """ failurePolicy = Field(six.text_type) - name = Field(six.text_type) + name = RequiredField(six.text_type) rules = ListField(Rule) @@ -74,13 +70,25 @@ class InitializerConfigurationList(Model): metadata = Field(ListMeta) +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + class ServiceReference(Model): """ ServiceReference holds a reference to Service.legacy.k8s.io """ - name = Field(six.text_type) - namespace = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) class AdmissionHookClientConfig(Model): @@ -89,8 +97,8 @@ class AdmissionHookClientConfig(Model): with the webhook """ - caBundle = Field(six.text_type) - service = Field(ServiceReference) + caBundle = RequiredField(six.text_type) + service = RequiredField(ServiceReference) class ExternalAdmissionHook(Model): @@ -99,9 +107,9 @@ class ExternalAdmissionHook(Model): and operations it applies to. """ - clientConfig = Field(AdmissionHookClientConfig) + clientConfig = RequiredField(AdmissionHookClientConfig) failurePolicy = Field(six.text_type) - name = Field(six.text_type) + name = RequiredField(six.text_type) rules = ListField(RuleWithOperations) diff --git a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py index 54fa374..477491f 100644 --- a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py @@ -7,12 +7,65 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_7.apimachinery.runtime import RawExtension from k8s.models.v1_7.kubernetes.api.v1 import PersistentVolumeClaim, PodTemplateSpec +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + class ControllerRevision(Model): """ ControllerRevision implements an immutable snapshot of state data. Clients are @@ -41,7 +94,7 @@ class Meta: data = Field(RawExtension) metadata = Field(ObjectMeta) - revision = Field(int) + revision = RequiredField(int) class ControllerRevisionList(Model): @@ -56,24 +109,6 @@ class ControllerRevisionList(Model): metadata = Field(ListMeta) -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DeploymentStrategy(Model): - """ - DeploymentStrategy describes how to replace existing pods with new ones. - """ - - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) - - class RollbackConfig(Model): """ @@ -82,22 +117,6 @@ class RollbackConfig(Model): revision = Field(int) -class DeploymentSpec(Model): - """ - DeploymentSpec is the specification of the desired behavior of the Deployment. - """ - - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = Field(PodTemplateSpec) - - class DeploymentRollback(Model): """ DeploymentRollback stores the information required to rollback a deployment. @@ -105,54 +124,11 @@ class DeploymentRollback(Model): apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "DeploymentRollback") - name = Field(six.text_type) - rollbackTo = Field(RollbackConfig) + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) updatedAnnotations = Field(dict) -class RollingUpdateStatefulSetStrategy(Model): - """ - RollingUpdateStatefulSetStrategy is used to communicate parameter for - RollingUpdateStatefulSetStrategyType. - """ - - partition = Field(int) - - -class StatefulSetUpdateStrategy(Model): - """ - StatefulSetUpdateStrategy indicates the strategy that the StatefulSet - controller will use to perform updates. It includes any additional parameters - necessary to perform the update for the indicated strategy. - """ - - rollingUpdate = Field(RollingUpdateStatefulSetStrategy) - type = Field(six.text_type) - - -class StatefulSetSpec(Model): - """ - A StatefulSetSpec is the specification of a StatefulSet. - """ - - podManagementPolicy = Field(six.text_type) - replicas = Field(int) - revisionHistoryLimit = Field(int) - selector = Field(LabelSelector) - serviceName = Field(six.text_type) - template = Field(PodTemplateSpec) - updateStrategy = Field(StatefulSetUpdateStrategy) - volumeClaimTemplates = ListField(PersistentVolumeClaim) - - -class ScaleSpec(Model): - """ - ScaleSpec describes the attributes of a scale subresource - """ - - replicas = Field(int) - - class StatefulSetStatus(Model): """ StatefulSetStatus represents the current state of a StatefulSet. @@ -162,7 +138,7 @@ class StatefulSetStatus(Model): currentRevision = Field(six.text_type) observedGeneration = Field(int) readyReplicas = Field(int) - replicas = Field(int) + replicas = RequiredField(int) updateRevision = Field(six.text_type) updatedReplicas = Field(int) @@ -207,6 +183,26 @@ class StatefulSetList(Model): metadata = Field(ListMeta) +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + class DeploymentCondition(Model): """ DeploymentCondition describes the state of a deployment at a certain point. @@ -216,8 +212,8 @@ class DeploymentCondition(Model): lastUpdateTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class DeploymentStatus(Model): @@ -235,6 +231,40 @@ class DeploymentStatus(Model): updatedReplicas = Field(int) +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. @@ -268,25 +298,3 @@ class DeploymentList(Model): items = ListField(Deployment) metadata = Field(ListMeta) - -class ScaleStatus(Model): - """ - ScaleStatus represents the current status of a scale subresource. - """ - - replicas = Field(int) - selector = Field(dict) - targetSelector = Field(six.text_type) - - -class Scale(Model): - """ - Scale represents a scaling request for a resource. - """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "Scale") - - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = Field(ScaleStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py index bfff54f..24727d4 100644 --- a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class TokenReviewSpec(Model): """ TokenReviewSpec is a description of the token authentication request. @@ -52,6 +60,6 @@ class Meta: kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) - spec = Field(TokenReviewSpec) + spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py index 1f5caaa..f93f184 100644 --- a/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class UserInfo(Model): """ UserInfo holds the information about the user needed to implement the user.Info @@ -52,6 +60,6 @@ class Meta: kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) - spec = Field(TokenReviewSpec) + spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py index 9132dec..95519ed 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py @@ -5,10 +5,28 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + class ResourceAttributes(Model): """ ResourceAttributes includes the authorization attributes available for resource @@ -24,24 +42,18 @@ class ResourceAttributes(Model): version = Field(six.text_type) -class SubjectAccessReviewStatus(Model): - """ - SubjectAccessReviewStatus - """ - - allowed = Field(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) - - -class NonResourceAttributes(Model): +class SubjectAccessReviewSpec(Model): """ - NonResourceAttributes includes the authorization attributes available for non- - resource requests to the Authorizer interface + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set """ - path = Field(six.text_type) - verb = Field(six.text_type) + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + user = Field(six.text_type) class SelfSubjectAccessReviewSpec(Model): @@ -55,36 +67,14 @@ class SelfSubjectAccessReviewSpec(Model): resourceAttributes = Field(ResourceAttributes) -class SelfSubjectAccessReview(Model): - """ - SelfSubjectAccessReview checks whether or the current user can perform an - action. Not filling in a spec.namespace means 'in all namespaces'. Self is a - special case, because users should always be able to check whether they can - perform an action - """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "SelfSubjectAccessReview") - - metadata = Field(ObjectMeta) - spec = Field(SelfSubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) - - -class SubjectAccessReviewSpec(Model): +class SubjectAccessReviewStatus(Model): """ - SubjectAccessReviewSpec is a description of the access request. Exactly one of - ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be - set + SubjectAccessReviewStatus """ - extra = Field(dict) - groups = ListField(six.text_type) - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) - user = Field(six.text_type) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class SubjectAccessReview(Model): @@ -99,7 +89,25 @@ class Meta: kind = Field(six.text_type, "SubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) @@ -116,6 +124,6 @@ class Meta: kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py index cb80978..49f9f44 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py @@ -5,18 +5,16 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ObjectMeta -class SubjectAccessReviewStatus(Model): - """ - SubjectAccessReviewStatus - """ - - allowed = Field(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class NonResourceAttributes(Model): @@ -44,6 +42,17 @@ class ResourceAttributes(Model): version = Field(six.text_type) +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + class SubjectAccessReviewSpec(Model): """ SubjectAccessReviewSpec is a description of the access request. Exactly one of @@ -58,20 +67,14 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SubjectAccessReview(Model): +class SubjectAccessReviewStatus(Model): """ - SubjectAccessReview checks whether or not a user or group can perform an - action. + SubjectAccessReviewStatus """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "SubjectAccessReview") - metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class LocalSubjectAccessReview(Model): @@ -87,19 +90,24 @@ class Meta: kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) -class SelfSubjectAccessReviewSpec(Model): +class SubjectAccessReview(Model): """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set + SubjectAccessReview checks whether or not a user or group can perform an + action. """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) class SelfSubjectAccessReview(Model): @@ -116,6 +124,6 @@ class Meta: kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) - spec = Field(SelfSubjectAccessReviewSpec) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py index fe9fbf9..b2f2fb1 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py @@ -7,10 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class ScaleSpec(Model): """ ScaleSpec describes the attributes of a scale subresource. @@ -25,7 +33,7 @@ class CrossVersionObjectReference(Model): referred resource. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) class HorizontalPodAutoscalerSpec(Model): @@ -33,20 +41,41 @@ class HorizontalPodAutoscalerSpec(Model): specification of a horizontal pod autoscaler. """ - maxReplicas = Field(int) + maxReplicas = RequiredField(int) minReplicas = Field(int) - scaleTargetRef = Field(CrossVersionObjectReference) + scaleTargetRef = RequiredField(CrossVersionObjectReference) targetCPUUtilizationPercentage = Field(int) +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + class HorizontalPodAutoscalerStatus(Model): """ current status of a horizontal pod autoscaler """ currentCPUUtilizationPercentage = Field(int) - currentReplicas = Field(int) - desiredReplicas = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) lastScaleTime = Field(datetime.datetime) observedGeneration = Field(int) @@ -84,24 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - -class ScaleStatus(Model): - """ - ScaleStatus represents the current status of a scale subresource. - """ - - replicas = Field(int) - selector = Field(six.text_type) - - -class Scale(Model): - """ - Scale represents a scaling request for a resource. - """ - apiVersion = Field(six.text_type, "autoscaling/v1") - kind = Field(six.text_type, "Scale") - - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = Field(ScaleStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py index 807bf53..edf0c1a 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py @@ -7,10 +7,28 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + class ResourceMetricStatus(Model): """ ResourceMetricStatus indicates the current value of a resource metric known to @@ -21,19 +39,8 @@ class ResourceMetricStatus(Model): """ currentAverageUtilization = Field(int) - currentAverageValue = Field(six.text_type) - name = Field(six.text_type) - - -class PodsMetricSource(Model): - """ - PodsMetricSource indicates how to scale on a metric describing each pod in the - current scale target (for example, transactions-processed-per-second). The - values will be averaged together before being compared to the target value. - """ - - metricName = Field(six.text_type) - targetAverageValue = Field(six.text_type) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) class HorizontalPodAutoscalerCondition(Model): @@ -45,8 +52,19 @@ class HorizontalPodAutoscalerCondition(Model): lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) class CrossVersionObjectReference(Model): @@ -55,7 +73,7 @@ class CrossVersionObjectReference(Model): referred resource. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) class ObjectMetricStatus(Model): @@ -64,9 +82,34 @@ class ObjectMetricStatus(Model): kubernetes object (for example, hits-per-second on an Ingress object). """ - currentValue = Field(six.text_type) - metricName = Field(six.text_type) - target = Field(CrossVersionObjectReference) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) class ObjectMetricSource(Model): @@ -75,9 +118,9 @@ class ObjectMetricSource(Model): object (for example, hits-per-second on an Ingress object). """ - metricName = Field(six.text_type) - target = Field(CrossVersionObjectReference) - targetValue = Field(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) class ResourceMetricSource(Model): @@ -91,7 +134,7 @@ class ResourceMetricSource(Model): be set. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) targetAverageUtilization = Field(int) targetAverageValue = Field(six.text_type) @@ -105,7 +148,7 @@ class MetricSpec(Model): object = Field(ObjectMetricSource) pods = Field(PodsMetricSource) resource = Field(ResourceMetricSource) - type = Field(six.text_type) + type = RequiredField(six.text_type) class HorizontalPodAutoscalerSpec(Model): @@ -114,45 +157,10 @@ class HorizontalPodAutoscalerSpec(Model): HorizontalPodAutoscaler. """ - maxReplicas = Field(int) + maxReplicas = RequiredField(int) metrics = ListField(MetricSpec) minReplicas = Field(int) - scaleTargetRef = Field(CrossVersionObjectReference) - - -class PodsMetricStatus(Model): - """ - PodsMetricStatus indicates the current value of a metric describing each pod in - the current scale target (for example, transactions-processed-per-second). - """ - - currentAverageValue = Field(six.text_type) - metricName = Field(six.text_type) - - -class MetricStatus(Model): - """ - MetricStatus describes the last-read state of a single metric. - """ - - object = Field(ObjectMetricStatus) - pods = Field(PodsMetricStatus) - resource = Field(ResourceMetricStatus) - type = Field(six.text_type) - - -class HorizontalPodAutoscalerStatus(Model): - """ - HorizontalPodAutoscalerStatus describes the current status of a horizontal pod - autoscaler. - """ - - conditions = ListField(HorizontalPodAutoscalerCondition) - currentMetrics = ListField(MetricStatus) - currentReplicas = Field(int) - desiredReplicas = Field(int) - lastScaleTime = Field(datetime.datetime) - observedGeneration = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) class HorizontalPodAutoscaler(Model): diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v1.py b/k8s/models/v1_7/kubernetes/apis/batch/v1.py index 95bec9c..6bdd3ac 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v1.py @@ -7,11 +7,32 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_7.kubernetes.api.v1 import PodTemplateSpec +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + class JobCondition(Model): """ JobCondition describes current state of a job. @@ -21,8 +42,8 @@ class JobCondition(Model): lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class JobStatus(Model): @@ -38,19 +59,6 @@ class JobStatus(Model): succeeded = Field(int) -class JobSpec(Model): - """ - JobSpec describes how the job execution will look like. - """ - - activeDeadlineSeconds = Field(int) - completions = Field(int) - manualSelector = Field(bool) - parallelism = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) - - class Job(Model): """ Job represents the configuration of a single job. diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py index 8f5b1e1..83f8ce1 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -7,19 +7,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta from k8s.models.v1_7.kubernetes.api.v1 import ObjectReference from k8s.models.v1_7.kubernetes.apis.batch.v1 import JobSpec -class CronJobStatus(Model): - """ - CronJobStatus represents the current state of a cron job. - """ - - active = ListField(ObjectReference) - lastScheduleTime = Field(datetime.datetime) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class JobTemplateSpec(Model): @@ -40,13 +39,22 @@ class CronJobSpec(Model): concurrencyPolicy = Field(six.text_type) failedJobsHistoryLimit = Field(int) - jobTemplate = Field(JobTemplateSpec) - schedule = Field(six.text_type) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) startingDeadlineSeconds = Field(int) successfulJobsHistoryLimit = Field(int) suspend = Field(bool) +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + class CronJob(Model): """ CronJob represents the configuration of a single cron job. diff --git a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py index e67076d..7a8cc63 100644 --- a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py @@ -7,10 +7,33 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + class CertificateSigningRequestCondition(Model): """ @@ -19,7 +42,7 @@ class CertificateSigningRequestCondition(Model): lastUpdateTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - type = Field(six.text_type) + type = RequiredField(six.text_type) class CertificateSigningRequestStatus(Model): @@ -31,21 +54,6 @@ class CertificateSigningRequestStatus(Model): conditions = ListField(CertificateSigningRequestCondition) -class CertificateSigningRequestSpec(Model): - """ - This information is immutable after the request is created. Only the Request - and Usages fields can be set on creation, other fields are derived by - Kubernetes and cannot be modified by users. - """ - - extra = Field(dict) - groups = ListField(six.text_type) - request = Field(six.text_type) - uid = Field(six.text_type) - usages = ListField(six.text_type) - username = Field(six.text_type) - - class CertificateSigningRequest(Model): """ Describes a certificate signing request @@ -55,8 +63,8 @@ class Meta: delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" - update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" diff --git a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py index 7df5366..aefcca4 100644 --- a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py @@ -7,80 +7,106 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta from k8s.models.v1_7.kubernetes.api.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions -class IngressBackend(Model): +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class APIVersion(Model): """ - IngressBackend describes all endpoints for a given service and port. + An APIVersion represents a single concrete version of an object model. """ - serviceName = Field(six.text_type) - servicePort = Field(six.text_type, alt_type=int) + name = Field(six.text_type) -class HTTPIngressPath(Model): +class ThirdPartyResource(Model): """ - HTTPIngressPath associates a path regex with a backend. Incoming urls matching - the path are forwarded to the backend. + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. """ + class Meta: + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResource") - backend = Field(IngressBackend) - path = Field(six.text_type) + description = Field(six.text_type) + metadata = Field(ObjectMeta) + versions = ListField(APIVersion) -class HTTPIngressRuleValue(Model): +class ThirdPartyResourceList(Model): """ - HTTPIngressRuleValue is a list of http selectors pointing to backends. In the - example: http:///? -> backend where where parts of the - url correspond to RFC 3986, this resource will be used to match against - everything after the last '/' and before the first '?' or '#'. + ThirdPartyResourceList is a list of ThirdPartyResources. """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ThirdPartyResourceList") - paths = ListField(HTTPIngressPath) + items = ListField(ThirdPartyResource) + metadata = Field(ListMeta) -class IngressRule(Model): +class IngressStatus(Model): """ - IngressRule represents the rules mapping the paths under a specified host to - the related backend services. Incoming requests are first evaluated for a host - match, then routed to the backend associated with the matching - IngressRuleValue. + IngressStatus describe the current state of the Ingress. """ - host = Field(six.text_type) - http = Field(HTTPIngressRuleValue) + loadBalancer = Field(LoadBalancerStatus) -class RollbackConfig(Model): +class IDRange(Model): """ - + ID Range provides a min/max of an allowed range of IDs. """ - revision = Field(int) + max = RequiredField(int) + min = RequiredField(int) -class DeploymentRollback(Model): +class RunAsUserStrategyOptions(Model): """ - DeploymentRollback stores the information required to rollback a deployment. + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - name = Field(six.text_type) - rollbackTo = Field(RollbackConfig) - updatedAnnotations = Field(dict) + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) -class NetworkPolicyPeer(Model): +class SupplementalGroupsStrategyOptions(Model): """ - + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. """ - namespaceSelector = Field(LabelSelector) - podSelector = Field(LabelSelector) + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) class DeploymentCondition(Model): @@ -92,8 +118,8 @@ class DeploymentCondition(Model): lastUpdateTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = Field(six.text_type) - type = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class DeploymentStatus(Model): @@ -111,14 +137,39 @@ class DeploymentStatus(Model): updatedReplicas = Field(int) -class HostPortRange(Model): +class SELinuxStrategyOptions(Model): """ - Host Port Range defines a range of host ports that will be enabled by a policy - for pods to use. It requires both the start and end to be defined. + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class NetworkPolicyPort(Model): + """ + """ - max = Field(int) - min = Field(int) + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) class RollingUpdateDaemonSet(Model): @@ -146,93 +197,258 @@ class DaemonSetSpec(Model): minReadySeconds = Field(int) revisionHistoryLimit = Field(int) selector = Field(LabelSelector) - template = Field(PodTemplateSpec) + template = RequiredField(PodTemplateSpec) templateGeneration = Field(int) updateStrategy = Field(DaemonSetUpdateStrategy) -class ReplicaSetCondition(Model): +class DaemonSet(Model): """ - ReplicaSetCondition describes the state of a replica set at a certain point. + DaemonSet represents the configuration of a daemon set. """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) type = Field(six.text_type) -class ReplicaSetStatus(Model): +class RollbackConfig(Model): """ - ReplicaSetStatus represents the current status of a ReplicaSet. + """ - availableReplicas = Field(int) - conditions = ListField(ReplicaSetCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) + revision = Field(int) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) -class ScaleStatus(Model): +class Deployment(Model): """ - represents the current status of a scale subresource. + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource """ replicas = Field(int) - selector = Field(dict) - targetSelector = Field(six.text_type) -class SELinuxStrategyOptions(Model): +class IngressBackend(Model): """ - SELinux Strategy Options defines the strategy type and any options used to - create the strategy. + IngressBackend describes all endpoints for a given service and port. """ - rule = Field(six.text_type) - seLinuxOptions = Field(SELinuxOptions) + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) -class IDRange(Model): +class HTTPIngressPath(Model): """ - ID Range provides a min/max of an allowed range of IDs. + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. """ - max = Field(int) - min = Field(int) + backend = RequiredField(IngressBackend) + path = Field(six.text_type) -class RunAsUserStrategyOptions(Model): +class HTTPIngressRuleValue(Model): """ - Run A sUser Strategy Options defines the strategy type and any options used to - create the strategy. + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. """ - ranges = ListField(IDRange) - rule = Field(six.text_type) + paths = ListField(HTTPIngressPath) -class SupplementalGroupsStrategyOptions(Model): +class IngressRule(Model): """ - SupplementalGroupsStrategyOptions defines the strategy type and options used to - create the strategy. + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. """ - ranges = ListField(IDRange) - rule = Field(six.text_type) + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) -class FSGroupStrategyOptions(Model): +class HostPortRange(Model): """ - FSGroupStrategyOptions defines the strategy type and options used to create the - strategy. + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. """ - ranges = ListField(IDRange) - rule = Field(six.text_type) + max = RequiredField(int) + min = RequiredField(int) class PodSecurityPolicySpec(Model): @@ -242,7 +458,7 @@ class PodSecurityPolicySpec(Model): allowedCapabilities = ListField(six.text_type) defaultAddCapabilities = ListField(six.text_type) - fsGroup = Field(FSGroupStrategyOptions) + fsGroup = RequiredField(FSGroupStrategyOptions) hostIPC = Field(bool) hostNetwork = Field(bool) hostPID = Field(bool) @@ -250,9 +466,9 @@ class PodSecurityPolicySpec(Model): privileged = Field(bool) readOnlyRootFilesystem = Field(bool) requiredDropCapabilities = ListField(six.text_type) - runAsUser = Field(RunAsUserStrategyOptions) - seLinux = Field(SELinuxStrategyOptions) - supplementalGroups = Field(SupplementalGroupsStrategyOptions) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) volumes = ListField(six.text_type) @@ -288,13 +504,13 @@ class PodSecurityPolicyList(Model): metadata = Field(ListMeta) -class NetworkPolicyPort(Model): +class NetworkPolicyPeer(Model): """ """ - port = Field(six.text_type, alt_type=int) - protocol = Field(six.text_type) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) class NetworkPolicyIngressRule(Model): @@ -313,7 +529,7 @@ class NetworkPolicySpec(Model): """ ingress = ListField(NetworkPolicyIngressRule) - podSelector = Field(LabelSelector) + podSelector = RequiredField(LabelSelector) class NetworkPolicy(Model): @@ -349,130 +565,14 @@ class NetworkPolicyList(Model): metadata = Field(ListMeta) -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DeploymentStrategy(Model): - """ - DeploymentStrategy describes how to replace existing pods with new ones. - """ - - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) - - -class DeploymentSpec(Model): - """ - DeploymentSpec is the specification of the desired behavior of the Deployment. - """ - - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = Field(PodTemplateSpec) - - -class Deployment(Model): - """ - Deployment enables declarative updates for Pods and ReplicaSets. - """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - list_all_url = "/apis/extensions/v1beta1/deployments" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Deployment") - - metadata = Field(ObjectMeta) - spec = Field(DeploymentSpec) - status = Field(DeploymentStatus) - - -class DeploymentList(Model): - """ - DeploymentList is a list of Deployments. - """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentList") - - items = ListField(Deployment) - metadata = Field(ListMeta) - - -class APIVersion(Model): - """ - An APIVersion represents a single concrete version of an object model. - """ - - name = Field(six.text_type) - - -class ThirdPartyResource(Model): - """ - A ThirdPartyResource is a generic representation of a resource, it is used by - add-ons and plugins to add new resource types to the API. It consists of one - or more Versions of the api. - """ - class Meta: - create_url = "/apis/extensions/v1beta1/thirdpartyresources" - delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" - update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResource") - - description = Field(six.text_type) - metadata = Field(ObjectMeta) - versions = ListField(APIVersion) - - -class ThirdPartyResourceList(Model): - """ - ThirdPartyResourceList is a list of ThirdPartyResources. - """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResourceList") - - items = ListField(ThirdPartyResource) - metadata = Field(ListMeta) - - -class IngressStatus(Model): - """ - IngressStatus describe the current state of the Ingress. - """ - - loadBalancer = Field(LoadBalancerStatus) - - -class ScaleSpec(Model): +class ScaleStatus(Model): """ - describes the attributes of a scale subresource + represents the current status of a scale subresource. """ - replicas = Field(int) + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) class Scale(Model): @@ -484,68 +584,32 @@ class Scale(Model): metadata = Field(ObjectMeta) spec = Field(ScaleSpec) - status = Field(ScaleStatus) - - -class DaemonSetStatus(Model): - """ - DaemonSetStatus represents the current status of a daemon set. - """ - - collisionCount = Field(int) - currentNumberScheduled = Field(int) - desiredNumberScheduled = Field(int) - numberAvailable = Field(int) - numberMisscheduled = Field(int) - numberReady = Field(int) - numberUnavailable = Field(int) - observedGeneration = Field(int) - updatedNumberScheduled = Field(int) - - -class DaemonSet(Model): - """ - DaemonSet represents the configuration of a daemon set. - """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - list_all_url = "/apis/extensions/v1beta1/daemonsets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSet") - - metadata = Field(ObjectMeta) - spec = Field(DaemonSetSpec) - status = Field(DaemonSetStatus) + status = ReadOnlyField(ScaleStatus) -class DaemonSetList(Model): +class ReplicaSetCondition(Model): """ - DaemonSetList is a collection of daemon sets. + ReplicaSetCondition describes the state of a replica set at a certain point. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSetList") - items = ListField(DaemonSet) - metadata = Field(ListMeta) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class ReplicaSetSpec(Model): +class ReplicaSetStatus(Model): """ - ReplicaSetSpec is the specification of a ReplicaSet. + ReplicaSetStatus represents the current status of a ReplicaSet. """ - minReadySeconds = Field(int) - replicas = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) class ReplicaSet(Model): @@ -568,7 +632,7 @@ class Meta: metadata = Field(ObjectMeta) spec = Field(ReplicaSetSpec) - status = Field(ReplicaSetStatus) + status = ReadOnlyField(ReplicaSetStatus) class ReplicaSetList(Model): @@ -581,59 +645,3 @@ class ReplicaSetList(Model): items = ListField(ReplicaSet) metadata = Field(ListMeta) - -class IngressTLS(Model): - """ - IngressTLS describes the transport layer security associated with an Ingress. - """ - - hosts = ListField(six.text_type) - secretName = Field(six.text_type) - - -class IngressSpec(Model): - """ - IngressSpec describes the Ingress the user wishes to exist. - """ - - backend = Field(IngressBackend) - rules = ListField(IngressRule) - tls = ListField(IngressTLS) - - -class Ingress(Model): - """ - Ingress is a collection of rules that allow inbound connections to reach the - endpoints defined by a backend. An Ingress can be configured to give services - externally-reachable urls, load balance traffic, terminate SSL, offer name - based virtual hosting etc. - """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" - list_all_url = "/apis/extensions/v1beta1/ingresses" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Ingress") - - metadata = Field(ObjectMeta) - spec = Field(IngressSpec) - status = Field(IngressStatus) - - -class IngressList(Model): - """ - IngressList is a collection of Ingress. - """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "IngressList") - - items = ListField(Ingress) - metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/networking/v1.py b/k8s/models/v1_7/kubernetes/apis/networking/v1.py index 3368fb3..0004eb7 100644 --- a/k8s/models/v1_7/kubernetes/apis/networking/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/networking/v1.py @@ -5,17 +5,16 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta -class NetworkPolicyPort(Model): - """ - NetworkPolicyPort describes a port to allow traffic on - """ - - port = Field(six.text_type, alt_type=int) - protocol = Field(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class NetworkPolicyPeer(Model): @@ -28,6 +27,15 @@ class NetworkPolicyPeer(Model): podSelector = Field(LabelSelector) +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + class NetworkPolicyIngressRule(Model): """ NetworkPolicyIngressRule describes a particular set of traffic that is allowed @@ -45,7 +53,7 @@ class NetworkPolicySpec(Model): """ ingress = ListField(NetworkPolicyIngressRule) - podSelector = Field(LabelSelector) + podSelector = RequiredField(LabelSelector) class NetworkPolicy(Model): diff --git a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py index e40361e..dae59ba 100644 --- a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py @@ -5,21 +5,45 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + class PodDisruptionBudgetStatus(Model): """ PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system. """ - currentHealthy = Field(int) - desiredHealthy = Field(int) - disruptedPods = Field(dict) - disruptionsAllowed = Field(int) - expectedPods = Field(int) + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) observedGeneration = Field(int) @@ -67,19 +91,3 @@ class PodDisruptionBudgetList(Model): items = ListField(PodDisruptionBudget) metadata = Field(ListMeta) - -class Eviction(Model): - """ - Eviction evicts a pod from its node subject to certain policies and safety - constraints. This is a subresource of Pod. A request to cause such an eviction - is created by POSTing to .../pods//evictions. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - - apiVersion = Field(six.text_type, "policy/v1beta1") - kind = Field(six.text_type, "Eviction") - - deleteOptions = Field(DeleteOptions) - metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py index a468872..c414103 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class Subject(Model): """ Subject contains a reference to the object or user identities a role binding @@ -16,10 +24,91 @@ class Subject(Model): non-objects such as user and group names. """ - name = Field(six.text_type) + name = RequiredField(six.text_type) namespace = Field(six.text_type) +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + class PolicyRule(Model): """ PolicyRule holds information that describes a policy rule, but does not contain @@ -99,84 +188,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - -class RoleRef(Model): - """ - RoleRef contains information that points to the role being used - """ - - apiGroup = Field(six.text_type) - name = Field(six.text_type) - - -class ClusterRoleBinding(Model): - """ - ClusterRoleBinding references a ClusterRole, but not contain it. It can - reference a ClusterRole in the global namespace, and adds who information via - Subject. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" - delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" - update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "ClusterRoleBinding") - - metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) - subjects = ListField(Subject) - - -class ClusterRoleBindingList(Model): - """ - ClusterRoleBindingList is a collection of ClusterRoleBindings - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "ClusterRoleBindingList") - - items = ListField(ClusterRoleBinding) - metadata = Field(ListMeta) - - -class RoleBinding(Model): - """ - RoleBinding references a role, but does not contain it. It can reference a - Role in the same namespace or a ClusterRole in the global namespace. It adds - who information via Subjects and namespace information by which namespace it - exists in. RoleBindings in a given namespace only have effect in that - namespace. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" - delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" - list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" - update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" - watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "RoleBinding") - - metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) - subjects = ListField(Subject) - - -class RoleBindingList(Model): - """ - RoleBindingList is a collection of RoleBindings - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") - kind = Field(six.text_type, "RoleBindingList") - - items = ListField(RoleBinding) - metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py index 7a59443..790bbba 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py @@ -5,17 +5,16 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta -class RoleRef(Model): - """ - RoleRef contains information that points to the role being used - """ - - apiGroup = Field(six.text_type) - name = Field(six.text_type) +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### class Subject(Model): @@ -26,10 +25,19 @@ class Subject(Model): """ apiGroup = Field(six.text_type) - name = Field(six.text_type) + name = RequiredField(six.text_type) namespace = Field(six.text_type) +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + class RoleBinding(Model): """ RoleBinding references a role, but does not contain it. It can reference a @@ -53,7 +61,7 @@ class Meta: kind = Field(six.text_type, "RoleBinding") metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) + roleRef = RequiredField(RoleRef) subjects = ListField(Subject) @@ -87,7 +95,7 @@ class Meta: kind = Field(six.text_type, "ClusterRoleBinding") metadata = Field(ObjectMeta) - roleRef = Field(RoleRef) + roleRef = RequiredField(RoleRef) subjects = ListField(Subject) @@ -116,38 +124,6 @@ class PolicyRule(Model): verbs = ListField(six.text_type) -class ClusterRole(Model): - """ - ClusterRole is a cluster level, logical grouping of PolicyRules that can be - referenced as a unit by a RoleBinding or ClusterRoleBinding. - """ - class Meta: - create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" - delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" - update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" - watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" - watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "ClusterRole") - - metadata = Field(ObjectMeta) - rules = ListField(PolicyRule) - - -class ClusterRoleList(Model): - """ - ClusterRoleList is a collection of ClusterRoles - """ - apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "ClusterRoleList") - - items = ListField(ClusterRole) - metadata = Field(ListMeta) - - class Role(Model): """ Role is a namespaced, logical grouping of PolicyRules that can be referenced as @@ -181,3 +157,35 @@ class RoleList(Model): items = ListField(Role) metadata = Field(ListMeta) + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py index 639c694..07ea03c 100644 --- a/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py @@ -10,6 +10,14 @@ from k8s.models.v1_7.kubernetes.api.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class PodPresetSpec(Model): """ PodPresetSpec is a description of a pod preset. diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1.py index f2fdb16..5fc7e04 100644 --- a/k8s/models/v1_7/kubernetes/apis/storage/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class StorageClass(Model): """ StorageClass describes the parameters for a class of storage for which @@ -32,7 +40,7 @@ class Meta: metadata = Field(ObjectMeta) parameters = Field(dict) - provisioner = Field(six.text_type) + provisioner = RequiredField(six.text_type) class StorageClassList(Model): diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py index 182c2b1..81d413a 100644 --- a/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py @@ -5,10 +5,18 @@ import six from k8s.base import Model -from k8s.fields import Field, ListField +from k8s.fields import Field, ListField, RequiredField from k8s.models.v1_7.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + class StorageClass(Model): """ StorageClass describes the parameters for a class of storage for which @@ -32,7 +40,7 @@ class Meta: metadata = Field(ObjectMeta) parameters = Field(dict) - provisioner = Field(six.text_type) + provisioner = RequiredField(six.text_type) class StorageClassList(Model): diff --git a/tests/k8s/test_fields.py b/tests/k8s/test_fields.py index d69b529..d474e55 100644 --- a/tests/k8s/test_fields.py +++ b/tests/k8s/test_fields.py @@ -7,7 +7,7 @@ from k8s import config from k8s.base import Model -from k8s.fields import Field, ListField, OnceField, ReadOnlyField, RequiredField +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField from k8s.models.v1_6.kubernetes.api.v1 import ObjectMeta @@ -18,7 +18,6 @@ class Meta: metadata = Field(ObjectMeta) field = Field(int) list_field = ListField(int) - once_field = OnceField(int) read_only_field = ReadOnlyField(int) alt_type_field = Field(int, alt_type=six.text_type) dict_field = Field(dict) @@ -34,7 +33,6 @@ def set_config_debug(self, monkeypatch): @pytest.mark.parametrize("field_name,initial_value,other_value", ( ("field", 1, 2), ("list_field", [1], [1, 2]), - ("once_field", 1, 2), ("_exec", 1, 2) )) def test_field_new(self, field_name, initial_value, other_value): @@ -54,12 +52,6 @@ def test_field_old(self, field_name, initial_value, other_value): setattr(model, field_name, other_value) assert getattr(model, field_name) == other_value - def test_once_field_old(self): - model = ModelTest.from_dict({"once_field": 1}) - assert model.once_field == 1 - model.once_field = 2 - assert model.once_field == 1 - def test_exec_field_old(self): model = ModelTest.from_dict({"exec": 1}) assert model._exec == 1 diff --git a/tests/k8s/test_model.py b/tests/k8s/test_model.py index 7ae9e45..55a5870 100644 --- a/tests/k8s/test_model.py +++ b/tests/k8s/test_model.py @@ -9,7 +9,7 @@ from k8s.base import Model from k8s.client import Client -from k8s.fields import Field, ListField, OnceField, ReadOnlyField +from k8s.fields import Field, ListField, ReadOnlyField from k8s.models.v1_6.apimachinery.apis.meta.v1 import ObjectMeta @@ -28,7 +28,6 @@ class Meta: metadata = Field(ObjectMeta) field = Field(int) list_field = ListField(int) - once_field = OnceField(int) read_only_field = ReadOnlyField(int) alt_type_field = Field(int, alt_type=six.text_type) dict_field = Field(dict) @@ -51,11 +50,10 @@ def test_unexpected_kwargs(self): def test_change(self, mock_response): metadata = ObjectMeta(name="my-name", namespace="my-namespace") - mock_response.json.return_value = {"field": 1, "list_field": [1], "once_field": 1, "read_only_field": 1} - instance = ModelTest.get_or_create(metadata=metadata, field=2, list_field=[2], once_field=2, read_only_field=2) + mock_response.json.return_value = {"field": 1, "list_field": [1], "read_only_field": 1} + instance = ModelTest.get_or_create(metadata=metadata, field=2, list_field=[2], read_only_field=2) assert instance.field == 2 assert instance.list_field == [2] - assert instance.once_field == 1 assert instance.read_only_field == 1 @pytest.mark.parametrize("value", (None, {}, {"key": "value"}), ids=("None", "Empty dict", "Key-Value")) @@ -102,7 +100,6 @@ def test_annotations_replace(self, mock_response): assert instance.metadata.annotations["will_overwrite"] == "that" assert "must_discard" not in instance.metadata.annotations - @pytest.mark.skip("Needs a generator to generate ReadOnlyFields when needed") def test_spec_merge(self, mock_response): mock_response.json.return_value = { "metadata": { From da9b33c998e45b40500a5acd75d5c31e00969c45 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 14:06:21 +0100 Subject: [PATCH 16/25] Sort generated models to reduce flux on new generation --- bin/generator.py | 14 +- k8s/models/v1_6/apimachinery/apis/meta/v1.py | 226 +- k8s/models/v1_6/kubernetes/api/v1.py | 2148 ++++++++-------- .../v1_6/kubernetes/apis/apps/v1beta1.py | 122 +- .../v1_6/kubernetes/apis/authentication/v1.py | 16 +- .../kubernetes/apis/authentication/v1beta1.py | 16 +- .../v1_6/kubernetes/apis/authorization/v1.py | 82 +- .../kubernetes/apis/authorization/v1beta1.py | 54 +- .../v1_6/kubernetes/apis/autoscaling/v1.py | 54 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 52 +- .../v1_6/kubernetes/apis/batch/v2alpha1.py | 36 +- .../kubernetes/apis/extensions/v1beta1.py | 544 ++-- .../v1_6/kubernetes/apis/policy/v1beta1.py | 26 +- k8s/models/v1_7/apimachinery/apis/meta/v1.py | 254 +- .../apis/apiregistration/v1beta1.py | 40 +- k8s/models/v1_7/kubernetes/api/v1.py | 2282 ++++++++--------- .../apis/admissionregistration/v1alpha1.py | 122 +- .../v1_7/kubernetes/apis/apps/v1beta1.py | 238 +- .../v1_7/kubernetes/apis/authentication/v1.py | 16 +- .../v1_7/kubernetes/apis/authorization/v1.py | 82 +- .../kubernetes/apis/authorization/v1beta1.py | 54 +- .../v1_7/kubernetes/apis/autoscaling/v1.py | 54 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 68 +- .../v1_7/kubernetes/apis/batch/v2alpha1.py | 18 +- .../kubernetes/apis/extensions/v1beta1.py | 540 ++-- .../v1_7/kubernetes/apis/networking/v1.py | 18 +- .../v1_7/kubernetes/apis/policy/v1beta1.py | 32 +- 27 files changed, 3610 insertions(+), 3598 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index efb7e90..307fa20 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -6,6 +6,7 @@ import re import shutil from collections import namedtuple, defaultdict, Counter +from functools import total_ordering import appdirs import requests @@ -52,11 +53,21 @@ def __init__(self, type): self.name = TYPE_MAPPING.get(type, type) +@total_ordering class Child(object): @property def parent_ref(self): return self.ref.rsplit(".", 1)[0] + def __eq__(self, other): + return self.ref == other.ref + + def __lt__(self, other): + return self.ref < other.ref + + def __hash__(self): + return hash(self.ref) + class Module(namedtuple("Module", ("ref", "name", "imports", "models")), Child): pass @@ -260,10 +271,11 @@ def _sort_models(self, models): if isinstance(field.type, Model) and field.type.parent_ref == model.parent_ref: dep = nodes.setdefault(field.type.ref, Node(field.type, [], [])) node.dependencies.append(dep) - for node in nodes.values(): + for node in sorted(nodes.values()): for dep in node.dependencies: dep.dependants.append(node) top_nodes = [n for n in nodes.values() if len(n.dependencies) == 0] + top_nodes.sort() models = [] while top_nodes: top_node = top_nodes.pop() diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py index 4ca9ebd..cae5a4e 100644 --- a/k8s/models/v1_6/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -19,99 +19,115 @@ ############################################################################### -class ServerAddressByClientCIDR(Model): +class WatchEvent(Model): """ - ServerAddressByClientCIDR helps the client to determine the server address that - they should use, depending on the clientCIDR that they match. + Event represents a single event to a watched resource. """ - clientCIDR = RequiredField(six.text_type) - serverAddress = RequiredField(six.text_type) + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) -class APIVersions(Model): +class StatusCause(Model): """ - APIVersions lists the versions that are available, to allow clients to discover - the API at /api, which is the root path of the legacy v1 API. + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. """ - serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) - versions = ListField(six.text_type) + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) -class GroupVersionForDiscovery(Model): +class StatusDetails(Model): """ - GroupVersion contains the 'group/version' and 'version' string of a version. It - is made a struct to keep extensibility. + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. """ - groupVersion = RequiredField(six.text_type) - version = RequiredField(six.text_type) + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) -class APIGroup(Model): +class ServerAddressByClientCIDR(Model): """ - APIGroup contains the name, the supported versions, and the preferred version - of a group. + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. """ - name = RequiredField(six.text_type) - preferredVersion = Field(GroupVersionForDiscovery) - serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) - versions = ListField(GroupVersionForDiscovery) + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) -class APIGroupList(Model): +class APIVersions(Model): """ - APIGroupList is a list of APIGroup, to allow clients to discover the API at - /apis. + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. """ - groups = ListField(APIGroup) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) -class LabelSelectorRequirement(Model): +class Preconditions(Model): """ - A label selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. """ - key = RequiredField(six.text_type) - operator = RequiredField(six.text_type) - values = ListField(six.text_type) + uid = Field(six.text_type) -class LabelSelector(Model): +class DeleteOptions(Model): """ - A label selector is a label query over a set of resources. The result of - matchLabels and matchExpressions are ANDed. An empty label selector matches all - objects. A null label selector matches no objects. + DeleteOptions may be provided when deleting an API object. """ - matchExpressions = ListField(LabelSelectorRequirement) - matchLabels = Field(dict) + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) -class APIResource(Model): +class OwnerReference(Model): """ - APIResource specifies the name of a resource and whether it is namespaced. + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. """ + blockOwnerDeletion = Field(bool) + controller = Field(bool) name = RequiredField(six.text_type) - namespaced = RequiredField(bool) - shortNames = ListField(six.text_type) - verbs = ListField(six.text_type) + uid = RequiredField(six.text_type) -class APIResourceList(Model): +class ObjectMeta(Model): """ - APIResourceList is a list of APIResource, it is used to expose the name of the - resources supported in a specific group and version, and if the resource is - namespaced. + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. """ - groupVersion = RequiredField(six.text_type) - resources = ListField(APIResource) + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) class ListMeta(Model): @@ -125,106 +141,90 @@ class ListMeta(Model): selfLink = ReadOnlyField(six.text_type) -class WatchEvent(Model): +class Status(Model): """ - Event represents a single event to a watched resource. + Status is a return value for calls that don't return other objects. """ - object = RequiredField(RawExtension) - type = RequiredField(six.text_type) + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) -class OwnerReference(Model): +class LabelSelectorRequirement(Model): """ - OwnerReference contains enough information to let you identify an owning - object. Currently, an owning object must be in the same namespace, so there is - no namespace field. + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - blockOwnerDeletion = Field(bool) - controller = Field(bool) - name = RequiredField(six.text_type) - uid = RequiredField(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class ObjectMeta(Model): +class LabelSelector(Model): """ - ObjectMeta is metadata that all persisted resources must have, which includes - all objects users must create. + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. """ - annotations = Field(dict) - clusterName = Field(six.text_type) - creationTimestamp = ReadOnlyField(datetime.datetime) - deletionGracePeriodSeconds = ReadOnlyField(int) - deletionTimestamp = ReadOnlyField(datetime.datetime) - finalizers = ListField(six.text_type) - generateName = Field(six.text_type) - generation = ReadOnlyField(int) - labels = Field(dict) - name = Field(six.text_type) - namespace = Field(six.text_type) - ownerReferences = ListField(OwnerReference) - resourceVersion = ReadOnlyField(six.text_type) - selfLink = ReadOnlyField(six.text_type) - uid = ReadOnlyField(six.text_type) + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) -class Preconditions(Model): +class GroupVersionForDiscovery(Model): """ - Preconditions must be fulfilled before an operation (update, delete, etc.) is - carried out. + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. """ - uid = Field(six.text_type) + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) -class DeleteOptions(Model): +class APIGroup(Model): """ - DeleteOptions may be provided when deleting an API object. + APIGroup contains the name, the supported versions, and the preferred version + of a group. """ - gracePeriodSeconds = Field(int) - orphanDependents = Field(bool) - preconditions = Field(Preconditions) - propagationPolicy = Field(six.text_type) + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) -class StatusCause(Model): +class APIGroupList(Model): """ - StatusCause provides more information about an api.Status failure, including - cases when multiple errors are encountered. + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. """ - field = Field(six.text_type) - message = Field(six.text_type) - reason = Field(six.text_type) + groups = ListField(APIGroup) -class StatusDetails(Model): +class APIResource(Model): """ - StatusDetails is a set of additional properties that MAY be set by the server - to provide additional information about a response. The Reason field of a - Status object defines what attributes will be set. Clients must ignore fields - that do not match the defined type of each attribute, and should assume that - any attribute may be empty, invalid, or under defined. + APIResource specifies the name of a resource and whether it is namespaced. """ - causes = ListField(StatusCause) - group = Field(six.text_type) - name = Field(six.text_type) - retryAfterSeconds = Field(int) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + verbs = ListField(six.text_type) -class Status(Model): +class APIResourceList(Model): """ - Status is a return value for calls that don't return other objects. + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. """ - code = Field(int) - details = Field(StatusDetails) - message = Field(six.text_type) - metadata = Field(ListMeta) - reason = Field(six.text_type) - status = Field(six.text_type) + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py index eeb1434..ae26983 100644 --- a/k8s/models/v1_6/kubernetes/api/v1.py +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -19,223 +19,203 @@ ############################################################################### -class ISCSIVolumeSource(Model): +class VsphereVirtualDiskVolumeSource(Model): """ - Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. - ISCSI volumes support ownership management and SELinux relabeling. + Represents a vSphere volume resource. """ fsType = Field(six.text_type) - iqn = RequiredField(six.text_type) - iscsiInterface = Field(six.text_type) - lun = RequiredField(int) - portals = ListField(six.text_type) - readOnly = Field(bool) - targetPortal = RequiredField(six.text_type) + volumePath = RequiredField(six.text_type) -class FCVolumeSource(Model): +class VolumeMount(Model): """ - Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as - read/write once. Fibre Channel volumes support ownership management and SELinux - relabeling. + VolumeMount describes a mounting of a Volume within a container. """ - fsType = Field(six.text_type) - lun = RequiredField(int) + mountPath = RequiredField(six.text_type) + name = RequiredField(six.text_type) readOnly = Field(bool) - targetWWNs = ListField(six.text_type) - - -class ObjectFieldSelector(Model): - """ - ObjectFieldSelector selects an APIVersioned field of an object. - """ - - fieldPath = RequiredField(six.text_type) - - -class LoadBalancerIngress(Model): - """ - LoadBalancerIngress represents the status of a load-balancer ingress point: - traffic intended for the service should be sent to an ingress point. - """ - - hostname = Field(six.text_type) - ip = Field(six.text_type) + subPath = Field(six.text_type) -class LoadBalancerStatus(Model): +class Toleration(Model): """ - LoadBalancerStatus represents the status of a load-balancer. + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . """ - ingress = ListField(LoadBalancerIngress) + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) -class ServiceStatus(Model): +class Taint(Model): """ - ServiceStatus represents the current status of a service. + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. """ - loadBalancer = Field(LoadBalancerStatus) + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) -class HTTPHeader(Model): +class NodeSpec(Model): """ - HTTPHeader describes a custom header to be used in HTTP probes + NodeSpec describes the attributes that a node is created with. """ - name = RequiredField(six.text_type) - value = RequiredField(six.text_type) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) -class HTTPGetAction(Model): +class TCPSocketAction(Model): """ - HTTPGetAction describes an action based on HTTP Get requests. + TCPSocketAction describes an action based on opening a socket """ - host = Field(six.text_type) - httpHeaders = ListField(HTTPHeader) - path = Field(six.text_type) port = RequiredField(six.text_type, alt_type=int) - scheme = Field(six.text_type) -class ContainerStateWaiting(Model): +class ServicePort(Model): """ - ContainerStateWaiting is a waiting state of a container. + ServicePort contains information on service's port. """ - message = Field(six.text_type) - reason = Field(six.text_type) + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) -class QuobyteVolumeSource(Model): +class ServiceSpec(Model): """ - Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do - not support ownership management or SELinux relabeling. + ServiceSpec describes the attributes that a user creates on a service. """ - group = Field(six.text_type) - readOnly = Field(bool) - registry = RequiredField(six.text_type) - user = Field(six.text_type) - volume = RequiredField(six.text_type) + clusterIP = Field(six.text_type) + deprecatedPublicIPs = ListField(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + type = Field(six.text_type) -class LocalObjectReference(Model): +class SecretKeySelector(Model): """ - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + SecretKeySelector selects a key of a Secret. """ + key = RequiredField(six.text_type) name = Field(six.text_type) + optional = Field(bool) -class ScaleIOVolumeSource(Model): +class SecretEnvSource(Model): """ - ScaleIOVolumeSource represents a persistent ScaleIO volume + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. """ - fsType = Field(six.text_type) - gateway = RequiredField(six.text_type) - protectionDomain = Field(six.text_type) - readOnly = Field(bool) - secretRef = RequiredField(LocalObjectReference) - sslEnabled = Field(bool) - storageMode = Field(six.text_type) - storagePool = Field(six.text_type) - system = RequiredField(six.text_type) - volumeName = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class CephFSVolumeSource(Model): +class Secret(Model): """ - Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs - volumes do not support ownership management or SELinux relabeling. + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") - monitors = ListField(six.text_type) - path = Field(six.text_type) - readOnly = Field(bool) - secretFile = Field(six.text_type) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) -class FlexVolumeSource(Model): +class SecretList(Model): """ - FlexVolume represents a generic volume resource that is provisioned/attached - using an exec based plugin. This is an alpha feature and may change in future. + SecretList is a list of Secret. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") - driver = RequiredField(six.text_type) - fsType = Field(six.text_type) - options = Field(dict) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + items = ListField(Secret) + metadata = Field(ListMeta) -class RBDVolumeSource(Model): +class SELinuxOptions(Model): """ - Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD - volumes support ownership management and SELinux relabeling. + SELinuxOptions are the labels to be applied to the container """ - fsType = Field(six.text_type) - image = RequiredField(six.text_type) - keyring = Field(six.text_type) - monitors = ListField(six.text_type) - pool = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) user = Field(six.text_type) -class Taint(Model): - """ - The node this Taint is attached to has the effect 'effect' on any pod that that - does not tolerate the Taint. - """ - - effect = RequiredField(six.text_type) - key = RequiredField(six.text_type) - timeAdded = Field(datetime.datetime) - value = Field(six.text_type) - - -class NodeSpec(Model): +class PodSecurityContext(Model): """ - NodeSpec describes the attributes that a node is created with. + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. """ - externalID = Field(six.text_type) - podCIDR = Field(six.text_type) - providerID = Field(six.text_type) - taints = ListField(Taint) - unschedulable = Field(bool) + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) -class AzureFileVolumeSource(Model): +class ResourceRequirements(Model): """ - AzureFile represents an Azure File Service mount on the host and bind mount to - the pod. + ResourceRequirements describes the compute resource requirements. """ - readOnly = Field(bool) - secretName = RequiredField(six.text_type) - shareName = RequiredField(six.text_type) + limits = Field(dict) + requests = Field(dict) -class PortworxVolumeSource(Model): +class PersistentVolumeClaimSpec(Model): """ - PortworxVolumeSource represents a Portworx volume resource. + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes """ - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) class ResourceQuotaStatus(Model): @@ -247,60 +227,13 @@ class ResourceQuotaStatus(Model): used = Field(dict) -class Capabilities(Model): +class ResourceQuotaSpec(Model): """ - Adds and removes POSIX capabilities from running containers. + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. """ - add = ListField(six.text_type) - drop = ListField(six.text_type) - - -class ContainerImage(Model): - """ - Describe a container image - """ - - names = ListField(six.text_type) - sizeBytes = Field(int) - - -class AttachedVolume(Model): - """ - AttachedVolume describes a volume attached to a node - """ - - devicePath = RequiredField(six.text_type) - name = RequiredField(six.text_type) - - -class EndpointPort(Model): - """ - EndpointPort is a tuple that describes a single port. - """ - - name = Field(six.text_type) - port = RequiredField(int) - protocol = Field(six.text_type) - - -class PersistentVolumeStatus(Model): - """ - PersistentVolumeStatus is the current status of a persistent volume. - """ - - message = Field(six.text_type) - phase = Field(six.text_type) - reason = Field(six.text_type) - - -class ResourceQuotaSpec(Model): - """ - ResourceQuotaSpec defines the desired hard limits to enforce for Quota. - """ - - hard = Field(dict) - scopes = ListField(six.text_type) + hard = Field(dict) + scopes = ListField(six.text_type) class ResourceQuota(Model): @@ -337,430 +270,359 @@ class ResourceQuotaList(Model): metadata = Field(ListMeta) -class VsphereVirtualDiskVolumeSource(Model): +class ResourceFieldSelector(Model): """ - Represents a vSphere volume resource. + ResourceFieldSelector represents container resources (cpu, memory) and their + output format """ - fsType = Field(six.text_type) - volumePath = RequiredField(six.text_type) + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) -class ComponentCondition(Model): +class ReplicationControllerCondition(Model): """ - Information about the condition of a component. + ReplicationControllerCondition describes the state of a replication controller + at a certain point. """ - error = Field(six.text_type) + lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) + reason = Field(six.text_type) status = RequiredField(six.text_type) type = RequiredField(six.text_type) -class ComponentStatus(Model): +class ReplicationControllerStatus(Model): """ - ComponentStatus (and ComponentStatusList) holds the cluster validation info. + ReplicationControllerStatus represents the current status of a replication + controller. """ - class Meta: - get_url = "/api/v1/componentstatuses/{name}" - list_all_url = "/api/v1/componentstatuses" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatus") - conditions = ListField(ComponentCondition) - metadata = Field(ObjectMeta) + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) -class ComponentStatusList(Model): +class QuobyteVolumeSource(Model): """ - Status of all the conditions for the component as a list of ComponentStatus - objects. + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatusList") - items = ListField(ComponentStatus) - metadata = Field(ListMeta) + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) -class EmptyDirVolumeSource(Model): +class PortworxVolumeSource(Model): """ - Represents an empty directory for a pod. Empty directory volumes support - ownership management and SELinux relabeling. + PortworxVolumeSource represents a Portworx volume resource. """ - medium = Field(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class ExecAction(Model): +class PodCondition(Model): """ - ExecAction describes a 'run in container' action. + PodCondition contains details for the current condition of this pod. """ - command = ListField(six.text_type) + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class ContainerStateTerminated(Model): +class PodAffinityTerm(Model): """ - ContainerStateTerminated is a terminated state of a container. + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running """ - containerID = Field(six.text_type) - exitCode = RequiredField(int) - finishedAt = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - signal = Field(int) - startedAt = Field(datetime.datetime) + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) -class ObjectReference(Model): +class WeightedPodAffinityTerm(Model): """ - ObjectReference contains enough information to let you inspect or modify the - referred object. + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) """ - fieldPath = Field(six.text_type) - name = Field(six.text_type) - namespace = Field(six.text_type) - resourceVersion = Field(six.text_type) - uid = Field(six.text_type) + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) -class EndpointAddress(Model): +class PodAntiAffinity(Model): """ - EndpointAddress is a tuple that describes single IP address. + Pod anti affinity is a group of inter pod anti affinity scheduling rules. """ - hostname = Field(six.text_type) - ip = RequiredField(six.text_type) - nodeName = Field(six.text_type) - targetRef = Field(ObjectReference) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class EndpointSubset(Model): +class PodAffinity(Model): """ - EndpointSubset is a group of addresses with a common set of ports. The expanded - set of endpoints is the Cartesian product of Addresses x Ports. For example, - given: - { - Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] - } - The - resulting set of endpoints can be viewed as: - a: [ 10.10.1.1:8675, - 10.10.2.2:8675 ], - b: [ 10.10.1.1:309, 10.10.2.2:309 ] + Pod affinity is a group of inter pod affinity scheduling rules. """ - addresses = ListField(EndpointAddress) - notReadyAddresses = ListField(EndpointAddress) - ports = ListField(EndpointPort) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class Endpoints(Model): +class PhotonPersistentDiskVolumeSource(Model): """ - Endpoints is a collection of endpoints that implement the actual service. - Example: - Name: 'mysvc', - Subsets: [ - { - Addresses: [{'ip': - '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, - {'name': 'b', 'port': 309}] - }, - { - Addresses: [{'ip': - '10.10.3.3'}], - Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': - 76}] - }, - ] + Represents a Photon Controller persistent disk resource. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/endpoints" - delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - list_all_url = "/api/v1/endpoints" - list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" - update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" - watchlist_all_url = "/api/v1/watch/endpoints" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Endpoints") - metadata = Field(ObjectMeta) - subsets = ListField(EndpointSubset) + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) -class EndpointsList(Model): +class PersistentVolumeStatus(Model): """ - EndpointsList is a list of endpoints. + PersistentVolumeStatus is the current status of a persistent volume. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EndpointsList") - items = ListField(Endpoints) - metadata = Field(ListMeta) + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) -class ServiceAccount(Model): +class PersistentVolumeClaimVolumeSource(Model): """ - ServiceAccount binds together: * a name, understood by users, and perhaps by - peripheral systems, for an identity * a principal that can be authenticated and - authorized * a set of secrets + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - list_all_url = "/api/v1/serviceaccounts" - list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" - watchlist_all_url = "/api/v1/watch/serviceaccounts" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccount") - automountServiceAccountToken = Field(bool) - imagePullSecrets = ListField(LocalObjectReference) - metadata = Field(ObjectMeta) - secrets = ListField(ObjectReference) + claimName = RequiredField(six.text_type) + readOnly = Field(bool) -class ServiceAccountList(Model): +class PersistentVolumeClaimStatus(Model): """ - ServiceAccountList is a list of ServiceAccount objects + PersistentVolumeClaimStatus is the current status of a persistent volume claim. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccountList") - items = ListField(ServiceAccount) - metadata = Field(ListMeta) + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) -class Binding(Model): +class PersistentVolumeClaim(Model): """ - Binding ties one object to another. For example, a pod is bound to a node by a - scheduler. + PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Binding") + kind = Field(six.text_type, "PersistentVolumeClaim") metadata = Field(ObjectMeta) - target = RequiredField(ObjectReference) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) -class TCPSocketAction(Model): +class PersistentVolumeClaimList(Model): """ - TCPSocketAction describes an action based on opening a socket + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") - port = RequiredField(six.text_type, alt_type=int) + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) -class Handler(Model): +class ObjectReference(Model): """ - Handler defines a specific action that should be taken + ObjectReference contains enough information to let you inspect or modify the + referred object. """ - _exec = Field(ExecAction) - httpGet = Field(HTTPGetAction) - tcpSocket = Field(TCPSocketAction) + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) -class Lifecycle(Model): +class EndpointAddress(Model): """ - Lifecycle describes actions that the management system should take in response - to container lifecycle events. For the PostStart and PreStop lifecycle - handlers, management of the container blocks until the action is complete, - unless the container process fails, in which case the handler is aborted. + EndpointAddress is a tuple that describes single IP address. """ - postStart = Field(Handler) - preStop = Field(Handler) + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) -class Probe(Model): +class Binding(Model): """ - Probe describes a health check to be performed against a container to determine - whether it is alive or ready to receive traffic. + Binding ties one object to another. For example, a pod is bound to a node by a + scheduler. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") - _exec = Field(ExecAction) - failureThreshold = Field(int) - httpGet = Field(HTTPGetAction) - initialDelaySeconds = Field(int) - periodSeconds = Field(int) - successThreshold = Field(int) - tcpSocket = Field(TCPSocketAction) - timeoutSeconds = Field(int) + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) -class NamespaceStatus(Model): +class ObjectFieldSelector(Model): """ - NamespaceStatus is information about the current status of a Namespace. + ObjectFieldSelector selects an APIVersioned field of an object. """ - phase = Field(six.text_type) + fieldPath = RequiredField(six.text_type) -class CinderVolumeSource(Model): +class DownwardAPIVolumeFile(Model): """ - Represents a cinder volume resource in Openstack. A Cinder volume must exist - before mounting to a container. The volume must also be in the same region as - the kubelet. Cinder volumes support ownership management and SELinux - relabeling. + DownwardAPIVolumeFile represents information to create the file containing the + pod field """ - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) -class HostPathVolumeSource(Model): +class DownwardAPIVolumeSource(Model): """ - Represents a host path mapped into a pod. Host path volumes do not support - ownership management or SELinux relabeling. + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. """ - path = RequiredField(six.text_type) + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) -class FlockerVolumeSource(Model): +class DownwardAPIProjection(Model): """ - Represents a Flocker volume mounted by the Flocker agent. One and only one of - datasetName and datasetUUID should be set. Flocker volumes do not support - ownership management or SELinux relabeling. + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. """ - datasetName = Field(six.text_type) - datasetUUID = Field(six.text_type) + items = ListField(DownwardAPIVolumeFile) -class Secret(Model): +class NodeSystemInfo(Model): """ - Secret holds secret data of a certain type. The total bytes of the values in - the Data field must be less than MaxSecretSize bytes. + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/secrets" - delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - list_all_url = "/api/v1/secrets" - list_ns_url = "/api/v1/namespaces/{namespace}/secrets" - update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" - watchlist_all_url = "/api/v1/watch/secrets" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Secret") - data = Field(dict) - metadata = Field(ObjectMeta) - stringData = Field(dict) - type = Field(six.text_type) + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) -class SecretList(Model): +class NodeSelectorRequirement(Model): """ - SecretList is a list of Secret. + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "SecretList") - items = ListField(Secret) - metadata = Field(ListMeta) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class LimitRangeItem(Model): +class NodeSelectorTerm(Model): """ - LimitRangeItem defines a min/max usage limit for any resource that matches on - kind. + A null or empty node selector term matches no objects. """ - default = Field(dict) - defaultRequest = Field(dict) - max = Field(dict) - maxLimitRequestRatio = Field(dict) - min = Field(dict) - type = Field(six.text_type) + matchExpressions = ListField(NodeSelectorRequirement) -class LimitRangeSpec(Model): +class PreferredSchedulingTerm(Model): """ - LimitRangeSpec defines a min/max usage limit for resources that match on kind. + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). """ - limits = ListField(LimitRangeItem) + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) -class LimitRange(Model): +class NodeSelector(Model): """ - LimitRange sets resource usage limits for each kind of resource in a Namespace. + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/limitranges" - delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - list_all_url = "/api/v1/limitranges" - list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" - update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" - watchlist_all_url = "/api/v1/watch/limitranges" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRange") - metadata = Field(ObjectMeta) - spec = Field(LimitRangeSpec) + nodeSelectorTerms = ListField(NodeSelectorTerm) -class LimitRangeList(Model): +class NodeAffinity(Model): """ - LimitRangeList is a list of LimitRange items. + Node affinity is a group of node affinity scheduling rules. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRangeList") - items = ListField(LimitRange) - metadata = Field(ListMeta) + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) -class SecretKeySelector(Model): +class Affinity(Model): """ - SecretKeySelector selects a key of a Secret. + Affinity is a group of affinity scheduling rules. """ - key = RequiredField(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) -class GCEPersistentDiskVolumeSource(Model): +class NodeCondition(Model): """ - Represents a Persistent Disk resource in Google Compute Engine. - - A GCE PD must - exist before mounting to a container. The disk must also be in the same GCE - project and zone as the kubelet. A GCE PD can only be mounted as read/write - once or read-only many times. GCE PDs support ownership management and SELinux - relabeling. + NodeCondition contains condition information for a node. """ - fsType = Field(six.text_type) - partition = Field(int) - pdName = RequiredField(six.text_type) - readOnly = Field(bool) + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) class NodeAddress(Model): @@ -772,696 +634,712 @@ class NodeAddress(Model): type = RequiredField(six.text_type) -class ContainerPort(Model): +class NamespaceStatus(Model): """ - ContainerPort represents a network port in a single container. + NamespaceStatus is information about the current status of a Namespace. """ - containerPort = RequiredField(int) - hostIP = Field(six.text_type) - hostPort = Field(int) - name = Field(six.text_type) - protocol = Field(six.text_type) - - -class PersistentVolumeClaimStatus(Model): - """ - PersistentVolumeClaimStatus is the current status of a persistent volume claim. - """ - - accessModes = ListField(six.text_type) - capacity = Field(dict) phase = Field(six.text_type) -class EventSource(Model): +class NamespaceSpec(Model): """ - EventSource contains information for an event. + NamespaceSpec describes the attributes on a Namespace. """ - component = Field(six.text_type) - host = Field(six.text_type) + finalizers = ListField(six.text_type) -class Event(Model): +class Namespace(Model): """ - Event is a report of an event somewhere in the cluster. + Namespace provides a scope for Names. Use of multiple namespaces is optional. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/events" - delete_url = "/api/v1/namespaces/{namespace}/events/{name}" - get_url = "/api/v1/namespaces/{namespace}/events/{name}" - list_all_url = "/api/v1/events" - list_ns_url = "/api/v1/namespaces/{namespace}/events" - update_url = "/api/v1/namespaces/{namespace}/events/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" - watchlist_all_url = "/api/v1/watch/events" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + update_url = "/api/v1/namespaces/{name}/finalize" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Event") + kind = Field(six.text_type, "Namespace") - count = Field(int) - firstTimestamp = Field(datetime.datetime) - involvedObject = RequiredField(ObjectReference) - lastTimestamp = Field(datetime.datetime) - message = Field(six.text_type) - metadata = RequiredField(ObjectMeta) - reason = Field(six.text_type) - source = Field(EventSource) - type = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) -class EventList(Model): +class NamespaceList(Model): """ - EventList is a list of events. + NamespaceList is a list of Namespaces. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EventList") + kind = Field(six.text_type, "NamespaceList") - items = ListField(Event) + items = ListField(Namespace) metadata = Field(ListMeta) -class NodeCondition(Model): +class NFSVolumeSource(Model): """ - NodeCondition contains condition information for a node. + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. """ - lastHeartbeatTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) -class PhotonPersistentDiskVolumeSource(Model): +class LocalObjectReference(Model): """ - Represents a Photon Controller persistent disk resource. + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. """ - fsType = Field(six.text_type) - pdID = RequiredField(six.text_type) + name = Field(six.text_type) -class KeyToPath(Model): +class ServiceAccount(Model): """ - Maps a string key to a path within a volume. + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") - key = RequiredField(six.text_type) - mode = Field(int) - path = RequiredField(six.text_type) + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) -class ConfigMapProjection(Model): +class ServiceAccountList(Model): """ - Adapts a ConfigMap into a projected volume. - - The contents of the target - ConfigMap's Data field will be presented in a projected volume as files using - the keys in the Data field as the file names, unless the items element is - populated with specific mappings of keys to paths. Note that this is identical - to a configmap volume source without the default mode. + ServiceAccountList is a list of ServiceAccount objects """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + items = ListField(ServiceAccount) + metadata = Field(ListMeta) -class ConfigMapVolumeSource(Model): +class ScaleIOVolumeSource(Model): """ - Adapts a ConfigMap into a volume. - - The contents of the target ConfigMap's Data - field will be presented in a volume as files using the keys in the Data field - as the file names, unless the items element is populated with specific mappings - of keys to paths. ConfigMap volumes support ownership management and SELinux - relabeling. + ScaleIOVolumeSource represents a persistent ScaleIO volume """ - defaultMode = Field(int) - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) -class SecretProjection(Model): +class RBDVolumeSource(Model): """ - Adapts a secret into a projected volume. - - The contents of the target Secret's - Data field will be presented in a projected volume as files using the keys in - the Data field as the file names. Note that this is identical to a secret - volume source without the default mode. + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. """ - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class SecretVolumeSource(Model): +class FlexVolumeSource(Model): """ - Adapts a Secret into a volume. - - The contents of the target Secret's Data field - will be presented in a volume as files using the keys in the Data field as the - file names. Secret volumes support ownership management and SELinux relabeling. + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. """ - defaultMode = Field(int) - items = ListField(KeyToPath) - optional = Field(bool) - secretName = Field(six.text_type) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) -class SecretEnvSource(Model): +class CephFSVolumeSource(Model): """ - SecretEnvSource selects a Secret to populate the environment variables with. - The contents of the target Secret's Data field will represent the key-value - pairs as environment variables. + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. """ - name = Field(six.text_type) - optional = Field(bool) + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class VolumeMount(Model): +class LoadBalancerIngress(Model): """ - VolumeMount describes a mounting of a Volume within a container. + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. """ - mountPath = RequiredField(six.text_type) - name = RequiredField(six.text_type) - readOnly = Field(bool) - subPath = Field(six.text_type) + hostname = Field(six.text_type) + ip = Field(six.text_type) -class AWSElasticBlockStoreVolumeSource(Model): +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. """ - Represents a Persistent Disk resource in AWS. - An AWS EBS disk must exist - before mounting to a container. The disk must also be in the same AWS zone as - the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS - volumes support ownership management and SELinux relabeling. + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. """ - fsType = Field(six.text_type) - partition = Field(int) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) + loadBalancer = Field(LoadBalancerStatus) -class ConfigMap(Model): +class Service(Model): """ - ConfigMap holds configuration data for pods to consume. + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/configmaps" - delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - list_all_url = "/api/v1/configmaps" - list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" - update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" - watchlist_all_url = "/api/v1/watch/configmaps" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMap") + kind = Field(six.text_type, "Service") - data = Field(dict) metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) -class ConfigMapList(Model): +class ServiceList(Model): """ - ConfigMapList is a resource containing a list of ConfigMap objects. + ServiceList holds a list of services. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMapList") + kind = Field(six.text_type, "ServiceList") - items = ListField(ConfigMap) + items = ListField(Service) metadata = Field(ListMeta) -class SELinuxOptions(Model): +class LimitRangeItem(Model): """ - SELinuxOptions are the labels to be applied to the container + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. """ - level = Field(six.text_type) - role = Field(six.text_type) + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) type = Field(six.text_type) - user = Field(six.text_type) -class PodSecurityContext(Model): +class LimitRangeSpec(Model): """ - PodSecurityContext holds pod-level security attributes and common container - settings. Some fields are also present in container.securityContext. Field - values of container.securityContext take precedence over field values of - PodSecurityContext. + LimitRangeSpec defines a min/max usage limit for resources that match on kind. """ - fsGroup = Field(int) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) - supplementalGroups = ListField(int) + limits = ListField(LimitRangeItem) -class SecurityContext(Model): +class LimitRange(Model): """ - SecurityContext holds security configuration that will be applied to a - container. Some fields are present in both SecurityContext and - PodSecurityContext. When both are set, the values in SecurityContext take - precedence. + LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") - capabilities = Field(Capabilities) - privileged = Field(bool) - readOnlyRootFilesystem = Field(bool) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) -class Toleration(Model): +class LimitRangeList(Model): """ - The pod this Toleration is attached to tolerates any taint that matches the - triple using the matching operator . + LimitRangeList is a list of LimitRange items. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") - effect = Field(six.text_type) - key = Field(six.text_type) - operator = Field(six.text_type) - tolerationSeconds = Field(int) - value = Field(six.text_type) + items = ListField(LimitRange) + metadata = Field(ListMeta) -class PodAffinityTerm(Model): +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): """ - Defines a set of pods (namely those matching the labelSelector relative to the - given namespace(s)) that this pod should be co-located (affinity) or not co- - located (anti-affinity) with, where co-located is defined as running on a node - whose value of the label with key tches that of any node on which - a pod of the set of pods is running + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. """ - labelSelector = Field(LabelSelector) - namespaces = ListField(six.text_type) - topologyKey = Field(six.text_type) + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) -class WeightedPodAffinityTerm(Model): +class SecretProjection(Model): """ - The weights of all of the matched WeightedPodAffinityTerm fields are added per- - node to find the most preferred node(s) + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. """ - podAffinityTerm = RequiredField(PodAffinityTerm) - weight = RequiredField(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PodAffinity(Model): +class ConfigMapVolumeSource(Model): """ - Pod affinity is a group of inter pod affinity scheduling rules. + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PodAntiAffinity(Model): +class ConfigMapProjection(Model): """ - Pod anti affinity is a group of inter pod anti affinity scheduling rules. + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class DaemonEndpoint(Model): +class VolumeProjection(Model): """ - DaemonEndpoint contains information about a single Daemon endpoint. + Projection that may be projected along with other supported volume types """ - Port = RequiredField(int) + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) -class NodeDaemonEndpoints(Model): +class ProjectedVolumeSource(Model): """ - NodeDaemonEndpoints lists ports opened by daemons running on the Node. + Represents a projected volume source """ - kubeletEndpoint = Field(DaemonEndpoint) + defaultMode = Field(int) + sources = ListField(VolumeProjection) -class ServicePort(Model): +class ISCSIVolumeSource(Model): """ - ServicePort contains information on service's port. + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. """ - name = Field(six.text_type) - nodePort = Field(int) - port = RequiredField(int) - protocol = Field(six.text_type) - targetPort = Field(six.text_type, alt_type=int) + fsType = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + targetPortal = RequiredField(six.text_type) -class ServiceSpec(Model): +class HostPathVolumeSource(Model): """ - ServiceSpec describes the attributes that a user creates on a service. + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. """ - clusterIP = Field(six.text_type) - deprecatedPublicIPs = ListField(six.text_type) - externalIPs = ListField(six.text_type) - externalName = Field(six.text_type) - loadBalancerIP = Field(six.text_type) - loadBalancerSourceRanges = ListField(six.text_type) - ports = ListField(ServicePort) - selector = Field(dict) - sessionAffinity = Field(six.text_type) - type = Field(six.text_type) + path = RequiredField(six.text_type) -class Service(Model): +class HTTPHeader(Model): """ - Service is a named abstraction of software service (for example, mysql) - consisting of local port (for example 3306) that the proxy listens on, and the - selector that determines which pods will answer requests sent through the - proxy. + HTTPHeader describes a custom header to be used in HTTP probes """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/services" - delete_url = "/api/v1/namespaces/{namespace}/services/{name}" - get_url = "/api/v1/namespaces/{namespace}/services/{name}" - list_all_url = "/api/v1/services" - list_ns_url = "/api/v1/namespaces/{namespace}/services" - update_url = "/api/v1/namespaces/{namespace}/services/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" - watchlist_all_url = "/api/v1/watch/services" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Service") - metadata = Field(ObjectMeta) - spec = Field(ServiceSpec) - status = ReadOnlyField(ServiceStatus) + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) -class ServiceList(Model): +class HTTPGetAction(Model): """ - ServiceList holds a list of services. + HTTPGetAction describes an action based on HTTP Get requests. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceList") - items = ListField(Service) - metadata = Field(ListMeta) + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) -class PodCondition(Model): +class GlusterfsVolumeSource(Model): """ - PodCondition contains details for the current condition of this pod. + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. """ - lastProbeTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) -class PersistentVolumeClaimVolumeSource(Model): +class GitRepoVolumeSource(Model): """ - PersistentVolumeClaimVolumeSource references the user's PVC in the same - namespace. This volume finds the bound PV and mounts that volume for the pod. A - PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another - type of volume that is owned by someone else (the system). + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. """ - claimName = RequiredField(six.text_type) - readOnly = Field(bool) + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) -class ConfigMapEnvSource(Model): +class GCEPersistentDiskVolumeSource(Model): """ - ConfigMapEnvSource selects a ConfigMap to populate the environment variables - with. + Represents a Persistent Disk resource in Google Compute Engine. - The contents of the target ConfigMap's Data field will represent the - key-value pairs as environment variables. + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. """ - name = Field(six.text_type) - optional = Field(bool) + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) -class EnvFromSource(Model): +class FlockerVolumeSource(Model): """ - EnvFromSource represents the source of a set of ConfigMaps + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. """ - configMapRef = Field(ConfigMapEnvSource) - prefix = Field(six.text_type) - secretRef = Field(SecretEnvSource) + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) -class GlusterfsVolumeSource(Model): +class FCVolumeSource(Model): """ - Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs - volumes do not support ownership management or SELinux relabeling. + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. """ - endpoints = RequiredField(six.text_type) - path = RequiredField(six.text_type) + fsType = Field(six.text_type) + lun = RequiredField(int) readOnly = Field(bool) + targetWWNs = ListField(six.text_type) -class ConfigMapKeySelector(Model): +class ExecAction(Model): """ - Selects a key from a ConfigMap. + ExecAction describes a 'run in container' action. """ - key = RequiredField(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + command = ListField(six.text_type) -class NodeSelectorRequirement(Model): +class Probe(Model): """ - A node selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. """ - key = RequiredField(six.text_type) - operator = RequiredField(six.text_type) - values = ListField(six.text_type) + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) -class NodeSelectorTerm(Model): +class Handler(Model): """ - A null or empty node selector term matches no objects. + Handler defines a specific action that should be taken """ - matchExpressions = ListField(NodeSelectorRequirement) + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) -class NodeSelector(Model): - """ - A node selector represents the union of the results of one or more label - queries over a set of nodes; that is, it represents the OR of the selectors - represented by the node selector terms. +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. """ - nodeSelectorTerms = ListField(NodeSelectorTerm) + postStart = Field(Handler) + preStop = Field(Handler) -class PreferredSchedulingTerm(Model): +class EventSource(Model): """ - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. - is also a no-op). + EventSource contains information for an event. """ - preference = RequiredField(NodeSelectorTerm) - weight = RequiredField(int) + component = Field(six.text_type) + host = Field(six.text_type) -class NodeAffinity(Model): +class Event(Model): """ - Node affinity is a group of node affinity scheduling rules. + Event is a report of an event somewhere in the cluster. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") - preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) - requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) -class Affinity(Model): +class EventList(Model): """ - Affinity is a group of affinity scheduling rules. + EventList is a list of events. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") - nodeAffinity = Field(NodeAffinity) - podAffinity = Field(PodAffinity) - podAntiAffinity = Field(PodAntiAffinity) + items = ListField(Event) + metadata = Field(ListMeta) -class NodeSystemInfo(Model): +class EndpointPort(Model): """ - NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + EndpointPort is a tuple that describes a single port. """ - architecture = RequiredField(six.text_type) - bootID = RequiredField(six.text_type) - containerRuntimeVersion = RequiredField(six.text_type) - kernelVersion = RequiredField(six.text_type) - kubeProxyVersion = RequiredField(six.text_type) - kubeletVersion = RequiredField(six.text_type) - machineID = RequiredField(six.text_type) - operatingSystem = RequiredField(six.text_type) - osImage = RequiredField(six.text_type) - systemUUID = RequiredField(six.text_type) + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) -class NodeStatus(Model): +class EndpointSubset(Model): """ - NodeStatus is information about the current status of a node. + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] """ - addresses = ListField(NodeAddress) - allocatable = Field(dict) - capacity = Field(dict) - conditions = ListField(NodeCondition) - daemonEndpoints = Field(NodeDaemonEndpoints) - images = ListField(ContainerImage) - nodeInfo = Field(NodeSystemInfo) - phase = Field(six.text_type) - volumesAttached = ListField(AttachedVolume) - volumesInUse = ListField(six.text_type) + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) -class Node(Model): +class Endpoints(Model): """ - Node is a worker node in Kubernetes. Each node will have a unique identifier in - the cache (i.e. in etcd). + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] """ class Meta: - create_url = "/api/v1/nodes" - delete_url = "/api/v1/nodes/{name}" - get_url = "/api/v1/nodes/{name}" - list_all_url = "/api/v1/nodes" - update_url = "/api/v1/nodes/{name}" - watch_url = "/api/v1/watch/nodes/{name}" - watchlist_all_url = "/api/v1/watch/nodes" + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Node") + kind = Field(six.text_type, "Endpoints") metadata = Field(ObjectMeta) - spec = Field(NodeSpec) - status = ReadOnlyField(NodeStatus) + subsets = ListField(EndpointSubset) -class NodeList(Model): +class EndpointsList(Model): """ - NodeList is the whole list of all Nodes which have been registered with master. + EndpointsList is a list of endpoints. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NodeList") + kind = Field(six.text_type, "EndpointsList") - items = ListField(Node) + items = ListField(Endpoints) metadata = Field(ListMeta) -class NamespaceSpec(Model): - """ - NamespaceSpec describes the attributes on a Namespace. - """ - - finalizers = ListField(six.text_type) - - -class Namespace(Model): +class EmptyDirVolumeSource(Model): """ - Namespace provides a scope for Names. Use of multiple namespaces is optional. + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. """ - class Meta: - create_url = "/api/v1/namespaces" - delete_url = "/api/v1/namespaces/{name}" - get_url = "/api/v1/namespaces/{name}" - list_all_url = "/api/v1/namespaces" - update_url = "/api/v1/namespaces/{name}/finalize" - update_url = "/api/v1/namespaces/{name}" - watch_url = "/api/v1/watch/namespaces/{name}" - watchlist_all_url = "/api/v1/watch/namespaces" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Namespace") - metadata = Field(ObjectMeta) - spec = Field(NamespaceSpec) - status = Field(NamespaceStatus) + medium = Field(six.text_type) -class NamespaceList(Model): +class DaemonEndpoint(Model): """ - NamespaceList is a list of Namespaces. + DaemonEndpoint contains information about a single Daemon endpoint. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NamespaceList") - items = ListField(Namespace) - metadata = Field(ListMeta) + Port = RequiredField(int) -class AzureDiskVolumeSource(Model): +class NodeDaemonEndpoints(Model): """ - AzureDisk represents an Azure Data Disk mount on the host and bind mount to the - pod. + NodeDaemonEndpoints lists ports opened by daemons running on the Node. """ - cachingMode = Field(six.text_type) - diskName = RequiredField(six.text_type) - diskURI = RequiredField(six.text_type) - fsType = Field(six.text_type) - readOnly = Field(bool) + kubeletEndpoint = Field(DaemonEndpoint) -class ReplicationControllerCondition(Model): +class ContainerStateWaiting(Model): """ - ReplicationControllerCondition describes the state of a replication controller - at a certain point. + ContainerStateWaiting is a waiting state of a container. """ - lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) -class ReplicationControllerStatus(Model): +class ContainerStateTerminated(Model): """ - ReplicationControllerStatus represents the current status of a replication - controller. + ContainerStateTerminated is a terminated state of a container. """ - availableReplicas = Field(int) - conditions = ListField(ReplicationControllerCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = RequiredField(int) + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) class ContainerStateRunning(Model): @@ -1517,27 +1395,35 @@ class PodStatus(Model): startTime = Field(datetime.datetime) -class GitRepoVolumeSource(Model): +class ContainerPort(Model): """ - Represents a volume that is populated with the contents of a git repository. - Git repo volumes do not support ownership management. Git repo volumes support - SELinux relabeling. + ContainerPort represents a network port in a single container. """ - directory = Field(six.text_type) - repository = RequiredField(six.text_type) - revision = Field(six.text_type) + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) -class ResourceFieldSelector(Model): +class ContainerImage(Model): """ - ResourceFieldSelector represents container resources (cpu, memory) and their - output format + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. """ - containerName = Field(six.text_type) - divisor = Field(six.text_type) - resource = RequiredField(six.text_type) + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) class EnvVarSource(Model): @@ -1561,248 +1447,297 @@ class EnvVar(Model): valueFrom = Field(EnvVarSource) -class DownwardAPIVolumeFile(Model): +class ConfigMapEnvSource(Model): """ - DownwardAPIVolumeFile represents information to create the file containing the - pod field + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. """ - fieldRef = Field(ObjectFieldSelector) - mode = Field(int) - path = RequiredField(six.text_type) - resourceFieldRef = Field(ResourceFieldSelector) + name = Field(six.text_type) + optional = Field(bool) -class DownwardAPIProjection(Model): +class EnvFromSource(Model): """ - Represents downward API info for projecting into a projected volume. Note that - this is identical to a downwardAPI volume source without the default mode. + EnvFromSource represents the source of a set of ConfigMaps """ - items = ListField(DownwardAPIVolumeFile) + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) -class VolumeProjection(Model): +class ConfigMap(Model): """ - Projection that may be projected along with other supported volume types + ConfigMap holds configuration data for pods to consume. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") - configMap = Field(ConfigMapProjection) - downwardAPI = Field(DownwardAPIProjection) - secret = Field(SecretProjection) + data = Field(dict) + metadata = Field(ObjectMeta) -class ProjectedVolumeSource(Model): +class ConfigMapList(Model): """ - Represents a projected volume source + ConfigMapList is a resource containing a list of ConfigMap objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") - defaultMode = Field(int) - sources = ListField(VolumeProjection) + items = ListField(ConfigMap) + metadata = Field(ListMeta) -class DownwardAPIVolumeSource(Model): +class ComponentCondition(Model): """ - DownwardAPIVolumeSource represents a volume containing downward API info. - Downward API volumes support ownership management and SELinux relabeling. + Information about the condition of a component. """ - defaultMode = Field(int) - items = ListField(DownwardAPIVolumeFile) + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class NFSVolumeSource(Model): +class ComponentStatus(Model): """ - Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not - support ownership management or SELinux relabeling. + ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") - path = RequiredField(six.text_type) + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) readOnly = Field(bool) - server = RequiredField(six.text_type) + volumeID = RequiredField(six.text_type) -class Volume(Model): +class Capabilities(Model): """ - Volume represents a named volume in a pod that may be accessed by any container - in the pod. + Adds and removes POSIX capabilities from running containers. """ - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - configMap = Field(ConfigMapVolumeSource) - downwardAPI = Field(DownwardAPIVolumeSource) - emptyDir = Field(EmptyDirVolumeSource) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - gitRepo = Field(GitRepoVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - name = RequiredField(six.text_type) - nfs = Field(NFSVolumeSource) - persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - projected = Field(ProjectedVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - secret = Field(SecretVolumeSource) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + add = ListField(six.text_type) + drop = ListField(six.text_type) -class PersistentVolumeSpec(Model): +class SecurityContext(Model): """ - PersistentVolumeSpec is the specification of a persistent volume. + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. """ - accessModes = ListField(six.text_type) - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - capacity = Field(dict) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - claimRef = Field(ObjectReference) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - nfs = Field(NFSVolumeSource) - persistentVolumeReclaimPolicy = Field(six.text_type) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - storageClassName = Field(six.text_type) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) -class PersistentVolume(Model): +class Container(Model): """ - PersistentVolume (PV) is a storage resource provisioned by an administrator. It - is analogous to a node. More info: http://kubernetes.io/docs/user-guide - /persistent-volumes + A single application container that you want to run within a pod. """ - class Meta: - create_url = "/api/v1/persistentvolumes" - delete_url = "/api/v1/persistentvolumes/{name}" - get_url = "/api/v1/persistentvolumes/{name}" - list_all_url = "/api/v1/persistentvolumes" - update_url = "/api/v1/persistentvolumes/{name}" - watch_url = "/api/v1/watch/persistentvolumes/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumes" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolume") - metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeSpec) - status = ReadOnlyField(PersistentVolumeStatus) + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) -class PersistentVolumeList(Model): +class AzureFileVolumeSource(Model): """ - PersistentVolumeList is a list of PersistentVolume items. + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeList") - items = ListField(PersistentVolume) - metadata = Field(ListMeta) + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) -class ResourceRequirements(Model): +class AzureDiskVolumeSource(Model): """ - ResourceRequirements describes the compute resource requirements. + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. """ - limits = Field(dict) - requests = Field(dict) + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) -class PersistentVolumeClaimSpec(Model): +class NodeStatus(Model): """ - PersistentVolumeClaimSpec describes the common attributes of storage devices - and allows a Source for provider-specific attributes + NodeStatus is information about the current status of a node. """ - accessModes = ListField(six.text_type) - resources = Field(ResourceRequirements) - selector = Field(LabelSelector) - storageClassName = Field(six.text_type) - volumeName = Field(six.text_type) + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) -class PersistentVolumeClaim(Model): +class Node(Model): """ - PersistentVolumeClaim is a user's request for and claim to a persistent volume + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - list_all_url = "/api/v1/persistentvolumeclaims" - list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaim") + kind = Field(six.text_type, "Node") metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeClaimSpec) - status = ReadOnlyField(PersistentVolumeClaimStatus) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) -class PersistentVolumeClaimList(Model): +class NodeList(Model): """ - PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + NodeList is the whole list of all Nodes which have been registered with master. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaimList") + kind = Field(six.text_type, "NodeList") - items = ListField(PersistentVolumeClaim) + items = ListField(Node) metadata = Field(ListMeta) -class Container(Model): +class AWSElasticBlockStoreVolumeSource(Model): """ - A single application container that you want to run within a pod. + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. """ - args = ListField(six.text_type) - command = ListField(six.text_type) - env = ListField(EnvVar) - envFrom = ListField(EnvFromSource) - image = Field(six.text_type) - imagePullPolicy = Field(six.text_type) - lifecycle = Field(Lifecycle) - livenessProbe = Field(Probe) + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) name = RequiredField(six.text_type) - ports = ListField(ContainerPort) - readinessProbe = Field(Probe) - resources = Field(ResourceRequirements) - securityContext = Field(SecurityContext) - stdin = Field(bool) - stdinOnce = Field(bool) - terminationMessagePath = Field(six.text_type) - terminationMessagePolicy = Field(six.text_type) - tty = Field(bool) - volumeMounts = ListField(VolumeMount) - workingDir = Field(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) class PodSpec(Model): @@ -1834,41 +1769,6 @@ class PodSpec(Model): volumes = ListField(Volume) -class Pod(Model): - """ - Pod is a collection of containers that can run on a host. This resource is - created by clients and scheduled onto hosts. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods" - delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" - get_url = "/api/v1/namespaces/{namespace}/pods/{name}" - list_all_url = "/api/v1/pods" - list_ns_url = "/api/v1/namespaces/{namespace}/pods" - update_url = "/api/v1/namespaces/{namespace}/pods/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" - watchlist_all_url = "/api/v1/watch/pods" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Pod") - - metadata = Field(ObjectMeta) - spec = Field(PodSpec) - status = ReadOnlyField(PodStatus) - - -class PodList(Model): - """ - PodList is a list of Pods. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PodList") - - items = ListField(Pod) - metadata = Field(ListMeta) - - class PodTemplateSpec(Model): """ PodTemplateSpec describes the data a pod should have when created from a @@ -1956,3 +1856,103 @@ class PodTemplateList(Model): items = ListField(PodTemplate) metadata = Field(ListMeta) + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + storageClassName = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: http://kubernetes.io/docs/user-guide + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py index 1975e72..b02bb38 100644 --- a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py @@ -20,62 +20,25 @@ ############################################################################### -class StatefulSetSpec(Model): - """ - A StatefulSetSpec is the specification of a StatefulSet. - """ - - replicas = Field(int) - selector = Field(LabelSelector) - serviceName = RequiredField(six.text_type) - template = RequiredField(PodTemplateSpec) - volumeClaimTemplates = ListField(PersistentVolumeClaim) - - -class ScaleStatus(Model): +class StatefulSetStatus(Model): """ - ScaleStatus represents the current status of a scale subresource. + StatefulSetStatus represents the current state of a StatefulSet. """ + observedGeneration = Field(int) replicas = RequiredField(int) - selector = Field(dict) - targetSelector = Field(six.text_type) - -class DeploymentCondition(Model): - """ - DeploymentCondition describes the state of a deployment at a certain point. - """ - - lastTransitionTime = Field(datetime.datetime) - lastUpdateTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) - -class DeploymentStatus(Model): +class StatefulSetSpec(Model): """ - DeploymentStatus is the most recently observed status of the Deployment. + A StatefulSetSpec is the specification of a StatefulSet. """ - availableReplicas = Field(int) - conditions = ListField(DeploymentCondition) - observedGeneration = Field(int) - readyReplicas = Field(int) replicas = Field(int) - unavailableReplicas = Field(int) - updatedReplicas = Field(int) - - -class StatefulSetStatus(Model): - """ - StatefulSetStatus represents the current state of a StatefulSet. - """ - - observedGeneration = Field(int) - replicas = RequiredField(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + volumeClaimTemplates = ListField(PersistentVolumeClaim) class StatefulSet(Model): @@ -118,24 +81,14 @@ class StatefulSetList(Model): metadata = Field(ListMeta) -class RollbackConfig(Model): - """ - - """ - - revision = Field(int) - - -class DeploymentRollback(Model): +class ScaleStatus(Model): """ - DeploymentRollback stores the information required to rollback a deployment. + ScaleStatus represents the current status of a scale subresource. """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - name = RequiredField(six.text_type) - rollbackTo = RequiredField(RollbackConfig) - updatedAnnotations = Field(dict) + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) class ScaleSpec(Model): @@ -176,6 +129,14 @@ class DeploymentStrategy(Model): type = Field(six.text_type) +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + class DeploymentSpec(Model): """ DeploymentSpec is the specification of the desired behavior of the Deployment. @@ -192,6 +153,45 @@ class DeploymentSpec(Model): template = RequiredField(PodTemplateSpec) +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py index a860d53..9a73d8b 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py @@ -17,14 +17,6 @@ ############################################################################### -class TokenReviewSpec(Model): - """ - TokenReviewSpec is a description of the token authentication request. - """ - - token = Field(six.text_type) - - class UserInfo(Model): """ UserInfo holds the information about the user needed to implement the user.Info @@ -47,6 +39,14 @@ class TokenReviewStatus(Model): user = Field(UserInfo) +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + class TokenReview(Model): """ TokenReview attempts to authenticate a token to a known user. Note: TokenReview diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py index a5b8f7b..0549606 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py @@ -17,14 +17,6 @@ ############################################################################### -class TokenReviewSpec(Model): - """ - TokenReviewSpec is a description of the token authentication request. - """ - - token = Field(six.text_type) - - class UserInfo(Model): """ UserInfo holds the information about the user needed to implement the user.Info @@ -47,6 +39,14 @@ class TokenReviewStatus(Model): user = Field(UserInfo) +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + class TokenReview(Model): """ TokenReview attempts to authenticate a token to a known user. Note: TokenReview diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py index e557ffe..9992965 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py @@ -17,14 +17,14 @@ ############################################################################### -class NonResourceAttributes(Model): +class SubjectAccessReviewStatus(Model): """ - NonResourceAttributes includes the authorization attributes available for non- - resource requests to the Authorizer interface + SubjectAccessReviewStatus """ - path = Field(six.text_type) - verb = Field(six.text_type) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class ResourceAttributes(Model): @@ -42,6 +42,16 @@ class ResourceAttributes(Model): version = Field(six.text_type) +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + class SubjectAccessReviewSpec(Model): """ SubjectAccessReviewSpec is a description of the access request. Exactly one of @@ -56,27 +66,6 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SelfSubjectAccessReviewSpec(Model): - """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set - """ - - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) - - -class SubjectAccessReviewStatus(Model): - """ - SubjectAccessReviewStatus - """ - - allowed = RequiredField(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) - - class SubjectAccessReview(Model): """ SubjectAccessReview checks whether or not a user or group can perform an @@ -93,37 +82,48 @@ class Meta: status = Field(SubjectAccessReviewStatus) -class SelfSubjectAccessReview(Model): +class LocalSubjectAccessReview(Model): """ - SelfSubjectAccessReview checks whether or the current user can perform an - action. Not filling in a spec.namespace means 'in all namespaces'. Self is a - special case, because users should always be able to check whether they can - perform an action + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. """ class Meta: - create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "SelfSubjectAccessReview") + kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = RequiredField(SelfSubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) -class LocalSubjectAccessReview(Model): +class SelfSubjectAccessReviewSpec(Model): """ - LocalSubjectAccessReview checks whether or not a user or group can perform an - action in a given namespace. Having a namespace scoped resource makes it much - easier to grant namespace scoped policy that includes permissions checking. + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action """ class Meta: - create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "LocalSubjectAccessReview") + kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) - spec = RequiredField(SubjectAccessReviewSpec) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py index 4f2f67c..2e0868c 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py @@ -17,6 +17,16 @@ ############################################################################### +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + class ResourceAttributes(Model): """ ResourceAttributes includes the authorization attributes available for resource @@ -42,17 +52,6 @@ class NonResourceAttributes(Model): verb = Field(six.text_type) -class SelfSubjectAccessReviewSpec(Model): - """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set - """ - - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) - - class SubjectAccessReviewSpec(Model): """ SubjectAccessReviewSpec is a description of the access request. Exactly one of @@ -67,14 +66,20 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SubjectAccessReviewStatus(Model): +class SubjectAccessReview(Model): """ - SubjectAccessReviewStatus + SubjectAccessReview checks whether or not a user or group can perform an + action. """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") - allowed = RequiredField(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) class LocalSubjectAccessReview(Model): @@ -94,20 +99,15 @@ class Meta: status = Field(SubjectAccessReviewStatus) -class SubjectAccessReview(Model): +class SelfSubjectAccessReviewSpec(Model): """ - SubjectAccessReview checks whether or not a user or group can perform an - action. + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "SubjectAccessReview") - metadata = Field(ObjectMeta) - spec = RequiredField(SubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) class SelfSubjectAccessReview(Model): diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py index d918683..ae0321f 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py @@ -19,41 +19,21 @@ ############################################################################### -class ScaleSpec(Model): - """ - ScaleSpec describes the attributes of a scale subresource. - """ - - replicas = Field(int) - - -class CrossVersionObjectReference(Model): - """ - CrossVersionObjectReference contains enough information to let you identify the - referred resource. - """ - - name = RequiredField(six.text_type) - - -class HorizontalPodAutoscalerSpec(Model): +class ScaleStatus(Model): """ - specification of a horizontal pod autoscaler. + ScaleStatus represents the current status of a scale subresource. """ - maxReplicas = RequiredField(int) - minReplicas = Field(int) - scaleTargetRef = RequiredField(CrossVersionObjectReference) - targetCPUUtilizationPercentage = Field(int) + replicas = RequiredField(int) + selector = Field(six.text_type) -class ScaleStatus(Model): +class ScaleSpec(Model): """ - ScaleStatus represents the current status of a scale subresource. + ScaleSpec describes the attributes of a scale subresource. """ - replicas = RequiredField(int) - selector = Field(six.text_type) + replicas = Field(int) class Scale(Model): @@ -80,6 +60,26 @@ class HorizontalPodAutoscalerStatus(Model): observedGeneration = Field(int) +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py index 871b259..2b64126 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py @@ -19,16 +19,6 @@ ############################################################################### -class PodsMetricStatus(Model): - """ - PodsMetricStatus indicates the current value of a metric describing each pod in - the current scale target (for example, transactions-processed-per-second). - """ - - currentAverageValue = RequiredField(six.text_type) - metricName = RequiredField(six.text_type) - - class ResourceMetricStatus(Model): """ ResourceMetricStatus indicates the current value of a resource metric known to @@ -43,6 +33,32 @@ class ResourceMetricStatus(Model): name = RequiredField(six.text_type) +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + class PodsMetricSource(Model): """ PodsMetricSource indicates how to scale on a metric describing each pod in the @@ -109,22 +125,6 @@ class ObjectMetricSource(Model): targetValue = RequiredField(six.text_type) -class ResourceMetricSource(Model): - """ - ResourceMetricSource indicates how to scale on a resource metric known to - Kubernetes, as specified in requests and limits, describing each pod in the - current scale target (e.g. CPU or memory). The values will be averaged - together before being compared to the target. Such metrics are built in to - Kubernetes, and have special scaling options on top of those available to - normal per-pod metrics using the 'pods' source. Only one 'target' type should - be set. - """ - - name = RequiredField(six.text_type) - targetAverageUtilization = Field(int) - targetAverageValue = Field(six.text_type) - - class MetricSpec(Model): """ MetricSpec specifies how to scale based on a single metric (only `type` and one diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py index 9e6d990..ad9baf8 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -21,15 +21,6 @@ ############################################################################### -class CronJobStatus(Model): - """ - CronJobStatus represents the current state of a cron job. - """ - - active = ListField(ObjectReference) - lastScheduleTime = Field(datetime.datetime) - - class JobTemplateSpec(Model): """ JobTemplateSpec describes the data a Job should have when created from a @@ -55,20 +46,29 @@ class CronJobSpec(Model): suspend = Field(bool) +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ class Meta: - create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" - delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - list_all_url = "/apis/batch/v2alpha1/cronjobs" - list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" - update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" - watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" - watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/scheduledjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/scheduledjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "ScheduledJob") diff --git a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py index dc8a064..da656ca 100644 --- a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py @@ -20,333 +20,284 @@ ############################################################################### -class APIVersion(Model): +class ScaleStatus(Model): """ - An APIVersion represents a single concrete version of an object model. + represents the current status of a scale subresource. """ - name = Field(six.text_type) + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) -class ThirdPartyResource(Model): +class ScaleSpec(Model): """ - A ThirdPartyResource is a generic representation of a resource, it is used by - add-ons and plugins to add new resource types to the API. It consists of one - or more Versions of the api. + describes the attributes of a scale subresource """ - class Meta: - create_url = "/apis/extensions/v1beta1/thirdpartyresources" - delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" - update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResource") - description = Field(six.text_type) - metadata = Field(ObjectMeta) - versions = ListField(APIVersion) + replicas = Field(int) -class ThirdPartyResourceList(Model): +class Scale(Model): """ - ThirdPartyResourceList is a list of ThirdPartyResources. + represents a scaling request for a resource. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResourceList") + kind = Field(six.text_type, "Scale") - items = ListField(ThirdPartyResource) - metadata = Field(ListMeta) + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) -class IngressTLS(Model): +class SELinuxStrategyOptions(Model): """ - IngressTLS describes the transport layer security associated with an Ingress. + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. """ - hosts = ListField(six.text_type) - secretName = Field(six.text_type) + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) -class IngressStatus(Model): +class RollingUpdateDeployment(Model): """ - IngressStatus describe the current state of the Ingress. + Spec to control the desired behavior of rolling update. """ - loadBalancer = Field(LoadBalancerStatus) + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) -class IDRange(Model): +class DeploymentStrategy(Model): """ - ID Range provides a min/max of an allowed range of IDs. + DeploymentStrategy describes how to replace existing pods with new ones. """ - max = RequiredField(int) - min = RequiredField(int) + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) -class RunAsUserStrategyOptions(Model): +class RollingUpdateDaemonSet(Model): """ - Run A sUser Strategy Options defines the strategy type and any options used to - create the strategy. + Spec to control the desired behavior of daemon set rolling update. """ - ranges = ListField(IDRange) - rule = RequiredField(six.text_type) + maxUnavailable = Field(six.text_type, alt_type=int) -class SupplementalGroupsStrategyOptions(Model): +class DaemonSetUpdateStrategy(Model): """ - SupplementalGroupsStrategyOptions defines the strategy type and options used to - create the strategy. + """ - ranges = ListField(IDRange) - rule = Field(six.text_type) + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) -class FSGroupStrategyOptions(Model): +class DaemonSetSpec(Model): """ - FSGroupStrategyOptions defines the strategy type and options used to create the - strategy. + DaemonSetSpec is the specification of a daemon set. """ - ranges = ListField(IDRange) - rule = Field(six.text_type) + minReadySeconds = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) -class DeploymentCondition(Model): +class RollbackConfig(Model): """ - DeploymentCondition describes the state of a deployment at a certain point. + """ - lastTransitionTime = Field(datetime.datetime) - lastUpdateTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + revision = Field(int) -class DeploymentStatus(Model): +class DeploymentSpec(Model): """ - DeploymentStatus is the most recently observed status of the Deployment. + DeploymentSpec is the specification of the desired behavior of the Deployment. """ - availableReplicas = Field(int) - conditions = ListField(DeploymentCondition) - observedGeneration = Field(int) - readyReplicas = Field(int) + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) replicas = Field(int) - unavailableReplicas = Field(int) - updatedReplicas = Field(int) - - -class SELinuxStrategyOptions(Model): - """ - SELinux Strategy Options defines the strategy type and any options used to - create the strategy. - """ - - rule = RequiredField(six.text_type) - seLinuxOptions = Field(SELinuxOptions) - - -class NetworkPolicyPort(Model): - """ - - """ - - port = Field(six.text_type, alt_type=int) - protocol = Field(six.text_type) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) -class DaemonSetStatus(Model): +class DeploymentRollback(Model): """ - DaemonSetStatus represents the current status of a daemon set. + DeploymentRollback stores the information required to rollback a deployment. """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") - currentNumberScheduled = RequiredField(int) - desiredNumberScheduled = RequiredField(int) - numberAvailable = Field(int) - numberMisscheduled = RequiredField(int) - numberReady = RequiredField(int) - numberUnavailable = Field(int) - observedGeneration = Field(int) - updatedNumberScheduled = Field(int) + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) -class RollingUpdateDaemonSet(Model): +class ReplicaSetSpec(Model): """ - Spec to control the desired behavior of daemon set rolling update. + ReplicaSetSpec is the specification of a ReplicaSet. """ - maxUnavailable = Field(six.text_type, alt_type=int) + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) -class DaemonSetUpdateStrategy(Model): +class ReplicaSetCondition(Model): """ - + ReplicaSetCondition describes the state of a replica set at a certain point. """ - rollingUpdate = Field(RollingUpdateDaemonSet) - type = Field(six.text_type) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class DaemonSetSpec(Model): +class ReplicaSetStatus(Model): """ - DaemonSetSpec is the specification of a daemon set. + ReplicaSetStatus represents the current status of a ReplicaSet. """ - minReadySeconds = Field(int) - selector = Field(LabelSelector) - template = RequiredField(PodTemplateSpec) - templateGeneration = Field(int) - updateStrategy = Field(DaemonSetUpdateStrategy) + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) -class DaemonSet(Model): +class ReplicaSet(Model): """ - DaemonSet represents the configuration of a daemon set. + ReplicaSet represents the configuration of a ReplicaSet. """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - list_all_url = "/apis/extensions/v1beta1/daemonsets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSet") + kind = Field(six.text_type, "ReplicaSet") metadata = Field(ObjectMeta) - spec = Field(DaemonSetSpec) - status = ReadOnlyField(DaemonSetStatus) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) -class DaemonSetList(Model): +class ReplicaSetList(Model): """ - DaemonSetList is a collection of daemon sets. + ReplicaSetList is a collection of ReplicaSets. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSetList") + kind = Field(six.text_type, "ReplicaSetList") - items = ListField(DaemonSet) + items = ListField(ReplicaSet) metadata = Field(ListMeta) -class ReplicaSetSpec(Model): - """ - ReplicaSetSpec is the specification of a ReplicaSet. - """ - - minReadySeconds = Field(int) - replicas = Field(int) - selector = Field(LabelSelector) - template = Field(PodTemplateSpec) - - -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DeploymentStrategy(Model): +class NetworkPolicyPort(Model): """ - DeploymentStrategy describes how to replace existing pods with new ones. + """ - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) -class RollbackConfig(Model): +class NetworkPolicyPeer(Model): """ """ - revision = Field(int) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) -class DeploymentRollback(Model): +class NetworkPolicyIngressRule(Model): """ - DeploymentRollback stores the information required to rollback a deployment. + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - name = RequiredField(six.text_type) - rollbackTo = RequiredField(RollbackConfig) - updatedAnnotations = Field(dict) + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) -class DeploymentSpec(Model): +class NetworkPolicySpec(Model): """ - DeploymentSpec is the specification of the desired behavior of the Deployment. + """ - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = RequiredField(PodTemplateSpec) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) -class Deployment(Model): +class NetworkPolicy(Model): """ - Deployment enables declarative updates for Pods and ReplicaSets. + """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - list_all_url = "/apis/extensions/v1beta1/deployments" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Deployment") + kind = Field(six.text_type, "NetworkPolicy") metadata = Field(ObjectMeta) - spec = Field(DeploymentSpec) - status = Field(DeploymentStatus) + spec = Field(NetworkPolicySpec) -class DeploymentList(Model): +class NetworkPolicyList(Model): """ - DeploymentList is a list of Deployments. + Network Policy List is a list of NetworkPolicy objects. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentList") + kind = Field(six.text_type, "NetworkPolicyList") - items = ListField(Deployment) + items = ListField(NetworkPolicy) metadata = Field(ListMeta) -class ScaleSpec(Model): +class IngressTLS(Model): """ - describes the attributes of a scale subresource + IngressTLS describes the transport layer security associated with an Ingress. """ - replicas = Field(int) + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) class IngressBackend(Model): @@ -438,6 +389,45 @@ class IngressList(Model): metadata = Field(ListMeta) +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + class HostPortRange(Model): """ Host Port Range defines a range of host ports that will be enabled by a policy @@ -501,144 +491,154 @@ class PodSecurityPolicyList(Model): metadata = Field(ListMeta) -class NetworkPolicyPeer(Model): - """ - - """ - - namespaceSelector = Field(LabelSelector) - podSelector = Field(LabelSelector) - - -class NetworkPolicyIngressRule(Model): +class DeploymentCondition(Model): """ - This NetworkPolicyIngressRule matches traffic if and only if the traffic - matches both ports AND from. + DeploymentCondition describes the state of a deployment at a certain point. """ - _from = ListField(NetworkPolicyPeer) - ports = ListField(NetworkPolicyPort) + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class NetworkPolicySpec(Model): +class DeploymentStatus(Model): """ - + DeploymentStatus is the most recently observed status of the Deployment. """ - ingress = ListField(NetworkPolicyIngressRule) - podSelector = RequiredField(LabelSelector) + availableReplicas = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) -class NetworkPolicy(Model): +class Deployment(Model): """ - + Deployment enables declarative updates for Pods and ReplicaSets. """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - list_all_url = "/apis/extensions/v1beta1/networkpolicies" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicy") + kind = Field(six.text_type, "Deployment") metadata = Field(ObjectMeta) - spec = Field(NetworkPolicySpec) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) -class NetworkPolicyList(Model): +class DeploymentList(Model): """ - Network Policy List is a list of NetworkPolicy objects. + DeploymentList is a list of Deployments. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicyList") + kind = Field(six.text_type, "DeploymentList") - items = ListField(NetworkPolicy) + items = ListField(Deployment) metadata = Field(ListMeta) -class ScaleStatus(Model): +class DaemonSetStatus(Model): """ - represents the current status of a scale subresource. + DaemonSetStatus represents the current status of a daemon set. """ - replicas = RequiredField(int) - selector = Field(dict) - targetSelector = Field(six.text_type) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) -class Scale(Model): +class DaemonSet(Model): """ - represents a scaling request for a resource. + DaemonSet represents the configuration of a daemon set. """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Scale") + kind = Field(six.text_type, "DaemonSet") metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = ReadOnlyField(ScaleStatus) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) -class ReplicaSetCondition(Model): +class DaemonSetList(Model): """ - ReplicaSetCondition describes the state of a replica set at a certain point. + DaemonSetList is a collection of daemon sets. """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + items = ListField(DaemonSet) + metadata = Field(ListMeta) -class ReplicaSetStatus(Model): +class APIVersion(Model): """ - ReplicaSetStatus represents the current status of a ReplicaSet. + An APIVersion represents a single concrete version of an object model. """ - availableReplicas = Field(int) - conditions = ListField(ReplicaSetCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = RequiredField(int) + name = Field(six.text_type) -class ReplicaSet(Model): +class ThirdPartyResource(Model): """ - ReplicaSet represents the configuration of a ReplicaSet. + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - list_all_url = "/apis/extensions/v1beta1/replicasets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ReplicaSet") + kind = Field(six.text_type, "ThirdPartyResource") + description = Field(six.text_type) metadata = Field(ObjectMeta) - spec = Field(ReplicaSetSpec) - status = ReadOnlyField(ReplicaSetStatus) + versions = ListField(APIVersion) -class ReplicaSetList(Model): +class ThirdPartyResourceList(Model): """ - ReplicaSetList is a collection of ReplicaSets. + ThirdPartyResourceList is a list of ThirdPartyResources. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ReplicaSetList") + kind = Field(six.text_type, "ThirdPartyResourceList") - items = ListField(ReplicaSet) + items = ListField(ThirdPartyResource) metadata = Field(ListMeta) diff --git a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py index f87ba05..77cc06b 100644 --- a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py @@ -17,19 +17,6 @@ ############################################################################### -class Eviction(Model): - """ - Eviction evicts a pod from its node subject to certain policies and safety - constraints. This is a subresource of Pod. A request to cause such an eviction - is created by POSTing to .../pods//evictions. - """ - apiVersion = Field(six.text_type, "policy/v1beta1") - kind = Field(six.text_type, "Eviction") - - deleteOptions = Field(DeleteOptions) - metadata = Field(ObjectMeta) - - class PodDisruptionBudgetStatus(Model): """ PodDisruptionBudgetStatus represents information about the status of a @@ -87,3 +74,16 @@ class PodDisruptionBudgetList(Model): items = ListField(PodDisruptionBudget) metadata = Field(ListMeta) + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py index d604a8e..b958f4e 100644 --- a/k8s/models/v1_7/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -19,15 +19,42 @@ ############################################################################### -class ListMeta(Model): +class WatchEvent(Model): """ - ListMeta describes metadata that synthetic resources must have, including lists - and various status objects. A resource may have only one of {ObjectMeta, - ListMeta}. + Event represents a single event to a watched resource. """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "WatchEvent") - resourceVersion = ReadOnlyField(six.text_type) - selfLink = ReadOnlyField(six.text_type) + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) class ServerAddressByClientCIDR(Model): @@ -52,15 +79,65 @@ class APIVersions(Model): versions = ListField(six.text_type) -class WatchEvent(Model): +class Preconditions(Model): """ - Event represents a single event to a watched resource. + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. """ apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") - kind = Field(six.text_type, "WatchEvent") + kind = Field(six.text_type, "DeleteOptions") - object = RequiredField(RawExtension) - type = RequiredField(six.text_type) + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) class LabelSelectorRequirement(Model): @@ -85,38 +162,45 @@ class LabelSelector(Model): matchLabels = Field(dict) -class APIResource(Model): +class Initializer(Model): """ - APIResource specifies the name of a resource and whether it is namespaced. + Initializer is information about an initializer that has not yet completed. """ - categories = ListField(six.text_type) name = RequiredField(six.text_type) - namespaced = RequiredField(bool) - shortNames = ListField(six.text_type) - singularName = RequiredField(six.text_type) - verbs = ListField(six.text_type) -class APIResourceList(Model): +class Initializers(Model): """ - APIResourceList is a list of APIResource, it is used to expose the name of the - resources supported in a specific group and version, and if the resource is - namespaced. + Initializers tracks the progress of initialization. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "APIResourceList") - groupVersion = RequiredField(six.text_type) - resources = ListField(APIResource) + pending = ListField(Initializer) + result = Field(Status) -class Initializer(Model): +class ObjectMeta(Model): """ - Initializer is information about an initializer that has not yet completed. + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. """ - name = RequiredField(six.text_type) + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) class GroupVersionForDiscovery(Model): @@ -154,112 +238,28 @@ class APIGroupList(Model): groups = ListField(APIGroup) -class OwnerReference(Model): +class APIResource(Model): """ - OwnerReference contains enough information to let you identify an owning - object. Currently, an owning object must be in the same namespace, so there is - no namespace field. + APIResource specifies the name of a resource and whether it is namespaced. """ - blockOwnerDeletion = Field(bool) - controller = Field(bool) + categories = ListField(six.text_type) name = RequiredField(six.text_type) - uid = RequiredField(six.text_type) - - -class Preconditions(Model): - """ - Preconditions must be fulfilled before an operation (update, delete, etc.) is - carried out. - """ - - uid = Field(six.text_type) - - -class DeleteOptions(Model): - """ - DeleteOptions may be provided when deleting an API object. - """ - apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") - kind = Field(six.text_type, "DeleteOptions") - - gracePeriodSeconds = Field(int) - orphanDependents = Field(bool) - preconditions = Field(Preconditions) - propagationPolicy = Field(six.text_type) - - -class StatusCause(Model): - """ - StatusCause provides more information about an api.Status failure, including - cases when multiple errors are encountered. - """ - - field = Field(six.text_type) - message = Field(six.text_type) - reason = Field(six.text_type) - - -class StatusDetails(Model): - """ - StatusDetails is a set of additional properties that MAY be set by the server - to provide additional information about a response. The Reason field of a - Status object defines what attributes will be set. Clients must ignore fields - that do not match the defined type of each attribute, and should assume that - any attribute may be empty, invalid, or under defined. - """ - - causes = ListField(StatusCause) - group = Field(six.text_type) - name = Field(six.text_type) - retryAfterSeconds = Field(int) - uid = Field(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) -class Status(Model): +class APIResourceList(Model): """ - Status is a return value for calls that don't return other objects. + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Status") - - code = Field(int) - details = Field(StatusDetails) - message = Field(six.text_type) - metadata = Field(ListMeta) - reason = Field(six.text_type) - status = Field(six.text_type) - - -class Initializers(Model): - """ - Initializers tracks the progress of initialization. - """ - - pending = ListField(Initializer) - result = Field(Status) - - -class ObjectMeta(Model): - """ - ObjectMeta is metadata that all persisted resources must have, which includes - all objects users must create. - """ + kind = Field(six.text_type, "APIResourceList") - annotations = Field(dict) - clusterName = Field(six.text_type) - creationTimestamp = ReadOnlyField(datetime.datetime) - deletionGracePeriodSeconds = ReadOnlyField(int) - deletionTimestamp = ReadOnlyField(datetime.datetime) - finalizers = ListField(six.text_type) - generateName = Field(six.text_type) - generation = ReadOnlyField(int) - initializers = Field(Initializers) - labels = Field(dict) - name = Field(six.text_type) - namespace = Field(six.text_type) - ownerReferences = ListField(OwnerReference) - resourceVersion = ReadOnlyField(six.text_type) - selfLink = ReadOnlyField(six.text_type) - uid = ReadOnlyField(six.text_type) + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py index 1c78dbf..a6a1d12 100644 --- a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py @@ -19,26 +19,6 @@ ############################################################################### -class APIServiceCondition(Model): - """ - - """ - - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) - - -class APIServiceStatus(Model): - """ - APIServiceStatus contains derived information about an API server - """ - - conditions = ListField(APIServiceCondition) - - class ServiceReference(Model): """ ServiceReference holds a reference to Service.legacy.k8s.io @@ -64,6 +44,26 @@ class APIServiceSpec(Model): versionPriority = RequiredField(int) +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + class APIService(Model): """ APIService represents a server for a particular GroupVersion. Name must be diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py index d12056e..b74a805 100644 --- a/k8s/models/v1_7/kubernetes/api/v1.py +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -19,201 +19,207 @@ ############################################################################### -class ObjectFieldSelector(Model): +class VsphereVirtualDiskVolumeSource(Model): """ - ObjectFieldSelector selects an APIVersioned field of an object. + Represents a vSphere volume resource. """ - fieldPath = RequiredField(six.text_type) + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) -class LoadBalancerIngress(Model): +class VolumeMount(Model): """ - LoadBalancerIngress represents the status of a load-balancer ingress point: - traffic intended for the service should be sent to an ingress point. + VolumeMount describes a mounting of a Volume within a container. """ - hostname = Field(six.text_type) - ip = Field(six.text_type) + mountPath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) -class LoadBalancerStatus(Model): +class Toleration(Model): """ - LoadBalancerStatus represents the status of a load-balancer. + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . """ - ingress = ListField(LoadBalancerIngress) + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) -class ServiceStatus(Model): +class Taint(Model): """ - ServiceStatus represents the current status of a service. + The node this Taint is attached to has the effect 'effect' on any pod that that + does not tolerate the Taint. """ - loadBalancer = Field(LoadBalancerStatus) + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) -class HTTPHeader(Model): +class NodeSpec(Model): """ - HTTPHeader describes a custom header to be used in HTTP probes + NodeSpec describes the attributes that a node is created with. """ - name = RequiredField(six.text_type) - value = RequiredField(six.text_type) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) -class HTTPGetAction(Model): +class TCPSocketAction(Model): """ - HTTPGetAction describes an action based on HTTP Get requests. + TCPSocketAction describes an action based on opening a socket """ host = Field(six.text_type) - httpHeaders = ListField(HTTPHeader) - path = Field(six.text_type) port = RequiredField(six.text_type, alt_type=int) - scheme = Field(six.text_type) - - -class ContainerStateWaiting(Model): - """ - ContainerStateWaiting is a waiting state of a container. - """ - - message = Field(six.text_type) - reason = Field(six.text_type) -class LocalObjectReference(Model): +class ServicePort(Model): """ - LocalObjectReference contains enough information to let you locate the - referenced object inside the same namespace. + ServicePort contains information on service's port. """ name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) -class ISCSIVolumeSource(Model): +class ServiceSpec(Model): """ - Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. - ISCSI volumes support ownership management and SELinux relabeling. + ServiceSpec describes the attributes that a user creates on a service. """ - chapAuthDiscovery = Field(bool) - chapAuthSession = Field(bool) - fsType = Field(six.text_type) - iqn = RequiredField(six.text_type) - iscsiInterface = Field(six.text_type) - lun = RequiredField(int) - portals = ListField(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - targetPortal = RequiredField(six.text_type) + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + type = Field(six.text_type) -class ScaleIOVolumeSource(Model): +class SecretKeySelector(Model): """ - ScaleIOVolumeSource represents a persistent ScaleIO volume + SecretKeySelector selects a key of a Secret. """ - fsType = Field(six.text_type) - gateway = RequiredField(six.text_type) - protectionDomain = Field(six.text_type) - readOnly = Field(bool) - secretRef = RequiredField(LocalObjectReference) - sslEnabled = Field(bool) - storageMode = Field(six.text_type) - storagePool = Field(six.text_type) - system = RequiredField(six.text_type) - volumeName = Field(six.text_type) + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class CephFSVolumeSource(Model): +class SecretEnvSource(Model): """ - Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs - volumes do not support ownership management or SELinux relabeling. + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. """ - monitors = ListField(six.text_type) - path = Field(six.text_type) - readOnly = Field(bool) - secretFile = Field(six.text_type) - secretRef = Field(LocalObjectReference) - user = Field(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class FlexVolumeSource(Model): +class Secret(Model): """ - FlexVolume represents a generic volume resource that is provisioned/attached - using an exec based plugin. This is an alpha feature and may change in future. + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") - driver = RequiredField(six.text_type) - fsType = Field(six.text_type) - options = Field(dict) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) -class StorageOSVolumeSource(Model): +class SecretList(Model): """ - Represents a StorageOS persistent volume resource. + SecretList is a list of Secret. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") - fsType = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) - volumeName = Field(six.text_type) - volumeNamespace = Field(six.text_type) + items = ListField(Secret) + metadata = Field(ListMeta) -class RBDVolumeSource(Model): +class SELinuxOptions(Model): """ - Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD - volumes support ownership management and SELinux relabeling. + SELinuxOptions are the labels to be applied to the container """ - fsType = Field(six.text_type) - image = RequiredField(six.text_type) - keyring = Field(six.text_type) - monitors = ListField(six.text_type) - pool = Field(six.text_type) - readOnly = Field(bool) - secretRef = Field(LocalObjectReference) + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) user = Field(six.text_type) -class Taint(Model): +class PodSecurityContext(Model): """ - The node this Taint is attached to has the effect 'effect' on any pod that that - does not tolerate the Taint. + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. """ - effect = RequiredField(six.text_type) - key = RequiredField(six.text_type) - timeAdded = Field(datetime.datetime) - value = Field(six.text_type) + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) -class NodeSpec(Model): +class ResourceRequirements(Model): """ - NodeSpec describes the attributes that a node is created with. + ResourceRequirements describes the compute resource requirements. """ - externalID = Field(six.text_type) - podCIDR = Field(six.text_type) - providerID = Field(six.text_type) - taints = ListField(Taint) - unschedulable = Field(bool) + limits = Field(dict) + requests = Field(dict) -class PortworxVolumeSource(Model): +class PersistentVolumeClaimSpec(Model): """ - PortworxVolumeSource represents a Portworx volume resource. + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes """ - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) class ResourceQuotaStatus(Model): @@ -225,69 +231,18 @@ class ResourceQuotaStatus(Model): used = Field(dict) -class QuobyteVolumeSource(Model): +class ResourceQuotaSpec(Model): """ - Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do - not support ownership management or SELinux relabeling. + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. """ - group = Field(six.text_type) - readOnly = Field(bool) - registry = RequiredField(six.text_type) - user = Field(six.text_type) - volume = RequiredField(six.text_type) + hard = Field(dict) + scopes = ListField(six.text_type) -class AttachedVolume(Model): - """ - AttachedVolume describes a volume attached to a node +class ResourceQuota(Model): """ - - devicePath = RequiredField(six.text_type) - name = RequiredField(six.text_type) - - -class ContainerImage(Model): - """ - Describe a container image - """ - - names = ListField(six.text_type) - sizeBytes = Field(int) - - -class EndpointPort(Model): - """ - EndpointPort is a tuple that describes a single port. - """ - - name = Field(six.text_type) - port = RequiredField(int) - protocol = Field(six.text_type) - - -class PersistentVolumeStatus(Model): - """ - PersistentVolumeStatus is the current status of a persistent volume. - """ - - message = Field(six.text_type) - phase = Field(six.text_type) - reason = Field(six.text_type) - - -class ResourceQuotaSpec(Model): - """ - ResourceQuotaSpec defines the desired hard limits to enforce for Quota. - """ - - hard = Field(dict) - scopes = ListField(six.text_type) - - -class ResourceQuota(Model): - """ - ResourceQuota sets aggregate quota restrictions enforced per namespace + ResourceQuota sets aggregate quota restrictions enforced per namespace """ class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" @@ -319,224 +274,210 @@ class ResourceQuotaList(Model): metadata = Field(ListMeta) -class VsphereVirtualDiskVolumeSource(Model): +class ResourceFieldSelector(Model): """ - Represents a vSphere volume resource. + ResourceFieldSelector represents container resources (cpu, memory) and their + output format """ - fsType = Field(six.text_type) - storagePolicyID = Field(six.text_type) - storagePolicyName = Field(six.text_type) - volumePath = RequiredField(six.text_type) + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) -class ComponentCondition(Model): +class ReplicationControllerCondition(Model): """ - Information about the condition of a component. + ReplicationControllerCondition describes the state of a replication controller + at a certain point. """ - error = Field(six.text_type) + lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) + reason = Field(six.text_type) status = RequiredField(six.text_type) type = RequiredField(six.text_type) -class ComponentStatus(Model): +class ReplicationControllerStatus(Model): """ - ComponentStatus (and ComponentStatusList) holds the cluster validation info. + ReplicationControllerStatus represents the current status of a replication + controller. """ - class Meta: - get_url = "/api/v1/componentstatuses/{name}" - list_all_url = "/api/v1/componentstatuses" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatus") - conditions = ListField(ComponentCondition) - metadata = Field(ObjectMeta) + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) -class ComponentStatusList(Model): +class QuobyteVolumeSource(Model): """ - Status of all the conditions for the component as a list of ComponentStatus - objects. + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ComponentStatusList") - items = ListField(ComponentStatus) - metadata = Field(ListMeta) + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) -class ExecAction(Model): +class PortworxVolumeSource(Model): """ - ExecAction describes a 'run in container' action. + PortworxVolumeSource represents a Portworx volume resource. """ - command = ListField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class ContainerStateTerminated(Model): +class PodCondition(Model): """ - ContainerStateTerminated is a terminated state of a container. + PodCondition contains details for the current condition of this pod. """ - containerID = Field(six.text_type) - exitCode = RequiredField(int) - finishedAt = Field(datetime.datetime) + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) message = Field(six.text_type) reason = Field(six.text_type) - signal = Field(int) - startedAt = Field(datetime.datetime) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class ObjectReference(Model): +class PodAffinityTerm(Model): """ - ObjectReference contains enough information to let you inspect or modify the - referred object. + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running """ - fieldPath = Field(six.text_type) - name = Field(six.text_type) - namespace = Field(six.text_type) - resourceVersion = Field(six.text_type) - uid = Field(six.text_type) + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) -class ServiceAccount(Model): +class WeightedPodAffinityTerm(Model): """ - ServiceAccount binds together: * a name, understood by users, and perhaps by - peripheral systems, for an identity * a principal that can be authenticated and - authorized * a set of secrets + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - list_all_url = "/api/v1/serviceaccounts" - list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" - update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" - watchlist_all_url = "/api/v1/watch/serviceaccounts" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccount") - automountServiceAccountToken = Field(bool) - imagePullSecrets = ListField(LocalObjectReference) - metadata = Field(ObjectMeta) - secrets = ListField(ObjectReference) + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) -class ServiceAccountList(Model): +class PodAntiAffinity(Model): """ - ServiceAccountList is a list of ServiceAccount objects + Pod anti affinity is a group of inter pod anti affinity scheduling rules. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ServiceAccountList") - items = ListField(ServiceAccount) - metadata = Field(ListMeta) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class Binding(Model): +class PodAffinity(Model): """ - Binding ties one object to another; for example, a pod is bound to a node by a - scheduler. Deprecated in 1.7, please use the bindings subresource of pods - instead. + Pod affinity is a group of inter pod affinity scheduling rules. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Binding") - metadata = Field(ObjectMeta) - target = RequiredField(ObjectReference) + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) -class EndpointAddress(Model): +class PhotonPersistentDiskVolumeSource(Model): """ - EndpointAddress is a tuple that describes single IP address. + Represents a Photon Controller persistent disk resource. """ - hostname = Field(six.text_type) - ip = RequiredField(six.text_type) - nodeName = Field(six.text_type) - targetRef = Field(ObjectReference) + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) -class EndpointSubset(Model): +class PersistentVolumeStatus(Model): """ - EndpointSubset is a group of addresses with a common set of ports. The expanded - set of endpoints is the Cartesian product of Addresses x Ports. For example, - given: - { - Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] - } - The - resulting set of endpoints can be viewed as: - a: [ 10.10.1.1:8675, - 10.10.2.2:8675 ], - b: [ 10.10.1.1:309, 10.10.2.2:309 ] + PersistentVolumeStatus is the current status of a persistent volume. """ - addresses = ListField(EndpointAddress) - notReadyAddresses = ListField(EndpointAddress) - ports = ListField(EndpointPort) + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) -class Endpoints(Model): +class PersistentVolumeClaimVolumeSource(Model): """ - Endpoints is a collection of endpoints that implement the actual service. - Example: - Name: 'mysvc', - Subsets: [ - { - Addresses: [{'ip': - '10.10.1.1'}, {'ip': '10.10.2.2'}], - Ports: [{'name': 'a', 'port': 8675}, - {'name': 'b', 'port': 309}] - }, - { - Addresses: [{'ip': - '10.10.3.3'}], - Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': - 76}] - }, - ] + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/endpoints" - delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - list_all_url = "/api/v1/endpoints" - list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" - update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" - watchlist_all_url = "/api/v1/watch/endpoints" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Endpoints") - metadata = Field(ObjectMeta) - subsets = ListField(EndpointSubset) + claimName = RequiredField(six.text_type) + readOnly = Field(bool) -class EndpointsList(Model): +class PersistentVolumeClaimStatus(Model): """ - EndpointsList is a list of endpoints. + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EndpointsList") + kind = Field(six.text_type, "PersistentVolumeClaim") - items = ListField(Endpoints) + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) metadata = Field(ListMeta) +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + class StorageOSPersistentVolumeSource(Model): """ Represents a StorageOS persistent volume resource. @@ -549,271 +490,228 @@ class StorageOSPersistentVolumeSource(Model): volumeNamespace = Field(six.text_type) -class TCPSocketAction(Model): +class EndpointAddress(Model): """ - TCPSocketAction describes an action based on opening a socket + EndpointAddress is a tuple that describes single IP address. """ - host = Field(six.text_type) - port = RequiredField(six.text_type, alt_type=int) + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) -class Handler(Model): +class Binding(Model): """ - Handler defines a specific action that should be taken + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") - _exec = Field(ExecAction) - httpGet = Field(HTTPGetAction) - tcpSocket = Field(TCPSocketAction) + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) -class Lifecycle(Model): +class ObjectFieldSelector(Model): """ - Lifecycle describes actions that the management system should take in response - to container lifecycle events. For the PostStart and PreStop lifecycle - handlers, management of the container blocks until the action is complete, - unless the container process fails, in which case the handler is aborted. + ObjectFieldSelector selects an APIVersioned field of an object. """ - postStart = Field(Handler) - preStop = Field(Handler) + fieldPath = RequiredField(six.text_type) -class Probe(Model): +class DownwardAPIVolumeFile(Model): """ - Probe describes a health check to be performed against a container to determine - whether it is alive or ready to receive traffic. + DownwardAPIVolumeFile represents information to create the file containing the + pod field """ - _exec = Field(ExecAction) - failureThreshold = Field(int) - httpGet = Field(HTTPGetAction) - initialDelaySeconds = Field(int) - periodSeconds = Field(int) - successThreshold = Field(int) - tcpSocket = Field(TCPSocketAction) - timeoutSeconds = Field(int) + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) -class NamespaceStatus(Model): +class DownwardAPIVolumeSource(Model): """ - NamespaceStatus is information about the current status of a Namespace. + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. """ - phase = Field(six.text_type) + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) -class FCVolumeSource(Model): +class DownwardAPIProjection(Model): """ - Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as - read/write once. Fibre Channel volumes support ownership management and SELinux - relabeling. + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. """ - fsType = Field(six.text_type) - lun = RequiredField(int) - readOnly = Field(bool) - targetWWNs = ListField(six.text_type) + items = ListField(DownwardAPIVolumeFile) -class CinderVolumeSource(Model): +class NodeSystemInfo(Model): """ - Represents a cinder volume resource in Openstack. A Cinder volume must exist - before mounting to a container. The volume must also be in the same region as - the kubelet. Cinder volumes support ownership management and SELinux - relabeling. + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. """ - fsType = Field(six.text_type) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) -class HostPathVolumeSource(Model): +class NodeSelectorRequirement(Model): """ - Represents a host path mapped into a pod. Host path volumes do not support - ownership management or SELinux relabeling. + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. """ - path = RequiredField(six.text_type) + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) -class FlockerVolumeSource(Model): +class NodeSelectorTerm(Model): """ - Represents a Flocker volume mounted by the Flocker agent. One and only one of - datasetName and datasetUUID should be set. Flocker volumes do not support - ownership management or SELinux relabeling. + A null or empty node selector term matches no objects. """ - datasetName = Field(six.text_type) - datasetUUID = Field(six.text_type) + matchExpressions = ListField(NodeSelectorRequirement) -class ReplicationControllerCondition(Model): +class PreferredSchedulingTerm(Model): """ - ReplicationControllerCondition describes the state of a replication controller - at a certain point. + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). """ - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) -class ReplicationControllerStatus(Model): +class NodeSelector(Model): """ - ReplicationControllerStatus represents the current status of a replication - controller. + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. """ - availableReplicas = Field(int) - conditions = ListField(ReplicationControllerCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = RequiredField(int) + nodeSelectorTerms = ListField(NodeSelectorTerm) -class Secret(Model): +class NodeAffinity(Model): """ - Secret holds secret data of a certain type. The total bytes of the values in - the Data field must be less than MaxSecretSize bytes. + Node affinity is a group of node affinity scheduling rules. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/secrets" - delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - list_all_url = "/api/v1/secrets" - list_ns_url = "/api/v1/namespaces/{namespace}/secrets" - update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" - watchlist_all_url = "/api/v1/watch/secrets" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Secret") - data = Field(dict) - metadata = Field(ObjectMeta) - stringData = Field(dict) - type = Field(six.text_type) + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) -class SecretList(Model): +class Affinity(Model): """ - SecretList is a list of Secret. + Affinity is a group of affinity scheduling rules. """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "SecretList") - items = ListField(Secret) - metadata = Field(ListMeta) + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) -class LimitRangeItem(Model): +class NodeCondition(Model): """ - LimitRangeItem defines a min/max usage limit for any resource that matches on - kind. + NodeCondition contains condition information for a node. """ - default = Field(dict) - defaultRequest = Field(dict) - max = Field(dict) - maxLimitRequestRatio = Field(dict) - min = Field(dict) - type = Field(six.text_type) + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class LimitRangeSpec(Model): +class NodeAddress(Model): """ - LimitRangeSpec defines a min/max usage limit for resources that match on kind. + NodeAddress contains information for the node's address. """ - limits = ListField(LimitRangeItem) + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class LimitRange(Model): +class NamespaceStatus(Model): """ - LimitRange sets resource usage limits for each kind of resource in a Namespace. + NamespaceStatus is information about the current status of a Namespace. """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/limitranges" - delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - list_all_url = "/api/v1/limitranges" - list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" - update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" - watchlist_all_url = "/api/v1/watch/limitranges" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRange") - - metadata = Field(ObjectMeta) - spec = Field(LimitRangeSpec) - -class LimitRangeList(Model): - """ - LimitRangeList is a list of LimitRange items. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "LimitRangeList") - - items = ListField(LimitRange) - metadata = Field(ListMeta) + phase = Field(six.text_type) -class SecretKeySelector(Model): +class NamespaceSpec(Model): """ - SecretKeySelector selects a key of a Secret. + NamespaceSpec describes the attributes on a Namespace. """ - key = RequiredField(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + finalizers = ListField(six.text_type) -class GCEPersistentDiskVolumeSource(Model): +class Namespace(Model): """ - Represents a Persistent Disk resource in Google Compute Engine. - - A GCE PD must - exist before mounting to a container. The disk must also be in the same GCE - project and zone as the kubelet. A GCE PD can only be mounted as read/write - once or read-only many times. GCE PDs support ownership management and SELinux - relabeling. + Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + update_url = "/api/v1/namespaces/{name}/finalize" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") - fsType = Field(six.text_type) - partition = Field(int) - pdName = RequiredField(six.text_type) - readOnly = Field(bool) + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) -class NodeAddress(Model): +class NamespaceList(Model): """ - NodeAddress contains information for the node's address. + NamespaceList is a list of Namespaces. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") - address = RequiredField(six.text_type) - type = RequiredField(six.text_type) + items = ListField(Namespace) + metadata = Field(ListMeta) -class ContainerPort(Model): +class NFSVolumeSource(Model): """ - ContainerPort represents a network port in a single container. + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. """ - containerPort = RequiredField(int) - hostIP = Field(six.text_type) - hostPort = Field(int) - name = Field(six.text_type) - protocol = Field(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) class LocalVolumeSource(Model): @@ -824,257 +722,166 @@ class LocalVolumeSource(Model): path = RequiredField(six.text_type) -class PersistentVolumeClaimStatus(Model): +class LocalObjectReference(Model): """ - PersistentVolumeClaimStatus is the current status of a persistent volume claim. + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. """ - accessModes = ListField(six.text_type) - capacity = Field(dict) - phase = Field(six.text_type) + name = Field(six.text_type) -class EventSource(Model): +class StorageOSVolumeSource(Model): """ - EventSource contains information for an event. + Represents a StorageOS persistent volume resource. """ - component = Field(six.text_type) - host = Field(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) -class Event(Model): +class ServiceAccount(Model): """ - Event is a report of an event somewhere in the cluster. + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/events" - delete_url = "/api/v1/namespaces/{namespace}/events/{name}" - get_url = "/api/v1/namespaces/{namespace}/events/{name}" - list_all_url = "/api/v1/events" - list_ns_url = "/api/v1/namespaces/{namespace}/events" - update_url = "/api/v1/namespaces/{namespace}/events/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" - watchlist_all_url = "/api/v1/watch/events" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Event") + kind = Field(six.text_type, "ServiceAccount") - count = Field(int) - firstTimestamp = Field(datetime.datetime) - involvedObject = RequiredField(ObjectReference) - lastTimestamp = Field(datetime.datetime) - message = Field(six.text_type) - metadata = RequiredField(ObjectMeta) - reason = Field(six.text_type) - source = Field(EventSource) - type = Field(six.text_type) + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) -class EventList(Model): +class ServiceAccountList(Model): """ - EventList is a list of events. + ServiceAccountList is a list of ServiceAccount objects """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "EventList") + kind = Field(six.text_type, "ServiceAccountList") - items = ListField(Event) + items = ListField(ServiceAccount) metadata = Field(ListMeta) -class AzureFileVolumeSource(Model): +class ScaleIOVolumeSource(Model): """ - AzureFile represents an Azure File Service mount on the host and bind mount to - the pod. + ScaleIOVolumeSource represents a persistent ScaleIO volume """ + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) readOnly = Field(bool) - secretName = RequiredField(six.text_type) - shareName = RequiredField(six.text_type) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) -class NodeCondition(Model): +class RBDVolumeSource(Model): """ - NodeCondition contains condition information for a node. + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. """ - lastHeartbeatTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class PhotonPersistentDiskVolumeSource(Model): +class ISCSIVolumeSource(Model): """ - Represents a Photon Controller persistent disk resource. + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. """ + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) fsType = Field(six.text_type) - pdID = RequiredField(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) -class EmptyDirVolumeSource(Model): +class FlexVolumeSource(Model): """ - Represents an empty directory for a pod. Empty directory volumes support - ownership management and SELinux relabeling. + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. """ - medium = Field(six.text_type) - sizeLimit = Field(six.text_type) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) -class HostAlias(Model): +class CephFSVolumeSource(Model): """ - HostAlias holds the mapping between IP and hostnames that will be injected as - an entry in the pod's hosts file. + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. """ - hostnames = ListField(six.text_type) - ip = Field(six.text_type) + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) -class KeyToPath(Model): +class LoadBalancerIngress(Model): """ - Maps a string key to a path within a volume. + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. """ - key = RequiredField(six.text_type) - mode = Field(int) - path = RequiredField(six.text_type) + hostname = Field(six.text_type) + ip = Field(six.text_type) -class ConfigMapProjection(Model): +class LoadBalancerStatus(Model): """ - Adapts a ConfigMap into a projected volume. - - The contents of the target - ConfigMap's Data field will be presented in a projected volume as files using - the keys in the Data field as the file names, unless the items element is - populated with specific mappings of keys to paths. Note that this is identical - to a configmap volume source without the default mode. + LoadBalancerStatus represents the status of a load-balancer. """ - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) + ingress = ListField(LoadBalancerIngress) -class ConfigMapVolumeSource(Model): +class ServiceStatus(Model): """ - Adapts a ConfigMap into a volume. - - The contents of the target ConfigMap's Data - field will be presented in a volume as files using the keys in the Data field - as the file names, unless the items element is populated with specific mappings - of keys to paths. ConfigMap volumes support ownership management and SELinux - relabeling. - """ - - defaultMode = Field(int) - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) - - -class SecretVolumeSource(Model): - """ - Adapts a Secret into a volume. - - The contents of the target Secret's Data field - will be presented in a volume as files using the keys in the Data field as the - file names. Secret volumes support ownership management and SELinux relabeling. - """ - - defaultMode = Field(int) - items = ListField(KeyToPath) - optional = Field(bool) - secretName = Field(six.text_type) - - -class SecretProjection(Model): - """ - Adapts a secret into a projected volume. - - The contents of the target Secret's - Data field will be presented in a projected volume as files using the keys in - the Data field as the file names. Note that this is identical to a secret - volume source without the default mode. - """ - - items = ListField(KeyToPath) - name = Field(six.text_type) - optional = Field(bool) - - -class SecretEnvSource(Model): - """ - SecretEnvSource selects a Secret to populate the environment variables with. - The contents of the target Secret's Data field will represent the key-value - pairs as environment variables. - """ - - name = Field(six.text_type) - optional = Field(bool) - - -class VolumeMount(Model): - """ - VolumeMount describes a mounting of a Volume within a container. - """ - - mountPath = RequiredField(six.text_type) - name = RequiredField(six.text_type) - readOnly = Field(bool) - subPath = Field(six.text_type) - - -class AWSElasticBlockStoreVolumeSource(Model): - """ - Represents a Persistent Disk resource in AWS. - - An AWS EBS disk must exist - before mounting to a container. The disk must also be in the same AWS zone as - the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS - volumes support ownership management and SELinux relabeling. - """ - - fsType = Field(six.text_type) - partition = Field(int) - readOnly = Field(bool) - volumeID = RequiredField(six.text_type) - - -class ServicePort(Model): - """ - ServicePort contains information on service's port. - """ - - name = Field(six.text_type) - nodePort = Field(int) - port = RequiredField(int) - protocol = Field(six.text_type) - targetPort = Field(six.text_type, alt_type=int) - - -class ServiceSpec(Model): - """ - ServiceSpec describes the attributes that a user creates on a service. + ServiceStatus represents the current status of a service. """ - clusterIP = Field(six.text_type) - externalIPs = ListField(six.text_type) - externalName = Field(six.text_type) - externalTrafficPolicy = Field(six.text_type) - healthCheckNodePort = Field(int) - loadBalancerIP = Field(six.text_type) - loadBalancerSourceRanges = ListField(six.text_type) - ports = ListField(ServicePort) - selector = Field(dict) - sessionAffinity = Field(six.text_type) - type = Field(six.text_type) + loadBalancer = Field(LoadBalancerStatus) class Service(Model): @@ -1114,165 +921,191 @@ class ServiceList(Model): metadata = Field(ListMeta) -class ConfigMap(Model): +class LimitRangeItem(Model): """ - ConfigMap holds configuration data for pods to consume. + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/configmaps" - delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - list_all_url = "/api/v1/configmaps" - list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" - update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" - watchlist_all_url = "/api/v1/watch/configmaps" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMap") + kind = Field(six.text_type, "LimitRange") - data = Field(dict) metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) -class ConfigMapList(Model): +class LimitRangeList(Model): """ - ConfigMapList is a resource containing a list of ConfigMap objects. + LimitRangeList is a list of LimitRange items. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "ConfigMapList") + kind = Field(six.text_type, "LimitRangeList") - items = ListField(ConfigMap) + items = ListField(LimitRange) metadata = Field(ListMeta) -class Capabilities(Model): +class KeyToPath(Model): """ - Adds and removes POSIX capabilities from running containers. + Maps a string key to a path within a volume. """ - add = ListField(six.text_type) - drop = ListField(six.text_type) + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) -class Toleration(Model): +class SecretVolumeSource(Model): """ - The pod this Toleration is attached to tolerates any taint that matches the - triple using the matching operator . + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. """ - effect = Field(six.text_type) - key = Field(six.text_type) - operator = Field(six.text_type) - tolerationSeconds = Field(int) - value = Field(six.text_type) + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) -class PodAffinityTerm(Model): +class SecretProjection(Model): """ - Defines a set of pods (namely those matching the labelSelector relative to the - given namespace(s)) that this pod should be co-located (affinity) or not co- - located (anti-affinity) with, where co-located is defined as running on a node - whose value of the label with key tches that of any node on which - a pod of the set of pods is running + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. """ - labelSelector = Field(LabelSelector) - namespaces = ListField(six.text_type) - topologyKey = Field(six.text_type) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class WeightedPodAffinityTerm(Model): +class ConfigMapVolumeSource(Model): """ - The weights of all of the matched WeightedPodAffinityTerm fields are added per- - node to find the most preferred node(s) + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. """ - podAffinityTerm = RequiredField(PodAffinityTerm) - weight = RequiredField(int) + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PodAffinity(Model): +class ConfigMapProjection(Model): """ - Pod affinity is a group of inter pod affinity scheduling rules. + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) -class PodAntiAffinity(Model): +class VolumeProjection(Model): """ - Pod anti affinity is a group of inter pod anti affinity scheduling rules. + Projection that may be projected along with other supported volume types """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) - requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) -class DaemonEndpoint(Model): +class ProjectedVolumeSource(Model): """ - DaemonEndpoint contains information about a single Daemon endpoint. - """ - - Port = RequiredField(int) - - -class NodeDaemonEndpoints(Model): - """ - NodeDaemonEndpoints lists ports opened by daemons running on the Node. + Represents a projected volume source """ - kubeletEndpoint = Field(DaemonEndpoint) + defaultMode = Field(int) + sources = ListField(VolumeProjection) -class PodCondition(Model): +class HostPathVolumeSource(Model): """ - PodCondition contains details for the current condition of this pod. + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. """ - lastProbeTime = Field(datetime.datetime) - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + path = RequiredField(six.text_type) -class PersistentVolumeClaimVolumeSource(Model): +class HostAlias(Model): """ - PersistentVolumeClaimVolumeSource references the user's PVC in the same - namespace. This volume finds the bound PV and mounts that volume for the pod. A - PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another - type of volume that is owned by someone else (the system). + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. """ - claimName = RequiredField(six.text_type) - readOnly = Field(bool) + hostnames = ListField(six.text_type) + ip = Field(six.text_type) -class ConfigMapEnvSource(Model): +class HTTPHeader(Model): """ - ConfigMapEnvSource selects a ConfigMap to populate the environment variables - with. - - The contents of the target ConfigMap's Data field will represent the - key-value pairs as environment variables. + HTTPHeader describes a custom header to be used in HTTP probes """ - name = Field(six.text_type) - optional = Field(bool) + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) -class EnvFromSource(Model): +class HTTPGetAction(Model): """ - EnvFromSource represents the source of a set of ConfigMaps + HTTPGetAction describes an action based on HTTP Get requests. """ - configMapRef = Field(ConfigMapEnvSource) - prefix = Field(six.text_type) - secretRef = Field(SecretEnvSource) + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) class GlusterfsVolumeSource(Model): @@ -1286,580 +1119,680 @@ class GlusterfsVolumeSource(Model): readOnly = Field(bool) -class ConfigMapKeySelector(Model): +class GitRepoVolumeSource(Model): """ - Selects a key from a ConfigMap. + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. """ - key = RequiredField(six.text_type) - name = Field(six.text_type) - optional = Field(bool) + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) -class NodeSelectorRequirement(Model): +class GCEPersistentDiskVolumeSource(Model): """ - A node selector requirement is a selector that contains values, a key, and an - operator that relates the key and values. + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. """ - key = RequiredField(six.text_type) - operator = RequiredField(six.text_type) - values = ListField(six.text_type) + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) -class NodeSelectorTerm(Model): +class FlockerVolumeSource(Model): """ - A null or empty node selector term matches no objects. + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. """ - matchExpressions = ListField(NodeSelectorRequirement) + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) -class PreferredSchedulingTerm(Model): +class FCVolumeSource(Model): """ - An empty preferred scheduling term matches all objects with implicit weight 0 - (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. - is also a no-op). + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. """ - preference = RequiredField(NodeSelectorTerm) - weight = RequiredField(int) + fsType = Field(six.text_type) + lun = RequiredField(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) -class NodeSelector(Model): +class ExecAction(Model): """ - A node selector represents the union of the results of one or more label - queries over a set of nodes; that is, it represents the OR of the selectors - represented by the node selector terms. + ExecAction describes a 'run in container' action. """ - nodeSelectorTerms = ListField(NodeSelectorTerm) + command = ListField(six.text_type) -class NodeAffinity(Model): +class Probe(Model): """ - Node affinity is a group of node affinity scheduling rules. + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. """ - preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) - requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) -class Affinity(Model): +class Handler(Model): """ - Affinity is a group of affinity scheduling rules. + Handler defines a specific action that should be taken """ - nodeAffinity = Field(NodeAffinity) - podAffinity = Field(PodAffinity) - podAntiAffinity = Field(PodAntiAffinity) + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) -class NodeSystemInfo(Model): +class Lifecycle(Model): """ - NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. """ - architecture = RequiredField(six.text_type) - bootID = RequiredField(six.text_type) - containerRuntimeVersion = RequiredField(six.text_type) - kernelVersion = RequiredField(six.text_type) - kubeProxyVersion = RequiredField(six.text_type) - kubeletVersion = RequiredField(six.text_type) - machineID = RequiredField(six.text_type) - operatingSystem = RequiredField(six.text_type) - osImage = RequiredField(six.text_type) - systemUUID = RequiredField(six.text_type) + postStart = Field(Handler) + preStop = Field(Handler) -class NodeStatus(Model): +class EventSource(Model): """ - NodeStatus is information about the current status of a node. + EventSource contains information for an event. """ - addresses = ListField(NodeAddress) - allocatable = Field(dict) - capacity = Field(dict) - conditions = ListField(NodeCondition) - daemonEndpoints = Field(NodeDaemonEndpoints) - images = ListField(ContainerImage) - nodeInfo = Field(NodeSystemInfo) - phase = Field(six.text_type) - volumesAttached = ListField(AttachedVolume) - volumesInUse = ListField(six.text_type) + component = Field(six.text_type) + host = Field(six.text_type) -class Node(Model): +class Event(Model): """ - Node is a worker node in Kubernetes. Each node will have a unique identifier in - the cache (i.e. in etcd). + Event is a report of an event somewhere in the cluster. """ class Meta: - create_url = "/api/v1/nodes" - delete_url = "/api/v1/nodes/{name}" - get_url = "/api/v1/nodes/{name}" - list_all_url = "/api/v1/nodes" - update_url = "/api/v1/nodes/{name}" - watch_url = "/api/v1/watch/nodes/{name}" - watchlist_all_url = "/api/v1/watch/nodes" + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Node") + kind = Field(six.text_type, "Event") - metadata = Field(ObjectMeta) - spec = Field(NodeSpec) - status = ReadOnlyField(NodeStatus) + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) -class NodeList(Model): +class EventList(Model): """ - NodeList is the whole list of all Nodes which have been registered with master. + EventList is a list of events. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NodeList") + kind = Field(six.text_type, "EventList") - items = ListField(Node) + items = ListField(Event) metadata = Field(ListMeta) -class NamespaceSpec(Model): +class EndpointPort(Model): """ - NamespaceSpec describes the attributes on a Namespace. + EndpointPort is a tuple that describes a single port. """ - finalizers = ListField(six.text_type) + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) -class Namespace(Model): +class EndpointSubset(Model): """ - Namespace provides a scope for Names. Use of multiple namespaces is optional. + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] """ - class Meta: - create_url = "/api/v1/namespaces" - delete_url = "/api/v1/namespaces/{name}" - get_url = "/api/v1/namespaces/{name}" - list_all_url = "/api/v1/namespaces" - update_url = "/api/v1/namespaces/{name}/finalize" - update_url = "/api/v1/namespaces/{name}" - watch_url = "/api/v1/watch/namespaces/{name}" - watchlist_all_url = "/api/v1/watch/namespaces" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Namespace") - metadata = Field(ObjectMeta) - spec = Field(NamespaceSpec) - status = Field(NamespaceStatus) + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) -class NamespaceList(Model): +class Endpoints(Model): """ - NamespaceList is a list of Namespaces. + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "NamespaceList") + kind = Field(six.text_type, "Endpoints") - items = ListField(Namespace) - metadata = Field(ListMeta) + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) -class AzureDiskVolumeSource(Model): +class EndpointsList(Model): """ - AzureDisk represents an Azure Data Disk mount on the host and bind mount to the - pod. + EndpointsList is a list of endpoints. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") - cachingMode = Field(six.text_type) - diskName = RequiredField(six.text_type) - diskURI = RequiredField(six.text_type) - fsType = Field(six.text_type) - readOnly = Field(bool) + items = ListField(Endpoints) + metadata = Field(ListMeta) -class ResourceFieldSelector(Model): +class EmptyDirVolumeSource(Model): """ - ResourceFieldSelector represents container resources (cpu, memory) and their - output format + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. """ - containerName = Field(six.text_type) - divisor = Field(six.text_type) - resource = RequiredField(six.text_type) + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) -class EnvVarSource(Model): +class DaemonEndpoint(Model): """ - EnvVarSource represents a source for the value of an EnvVar. + DaemonEndpoint contains information about a single Daemon endpoint. """ - configMapKeyRef = Field(ConfigMapKeySelector) - fieldRef = Field(ObjectFieldSelector) - resourceFieldRef = Field(ResourceFieldSelector) - secretKeyRef = Field(SecretKeySelector) + Port = RequiredField(int) -class EnvVar(Model): +class NodeDaemonEndpoints(Model): """ - EnvVar represents an environment variable present in a Container. + NodeDaemonEndpoints lists ports opened by daemons running on the Node. """ - name = RequiredField(six.text_type) - value = Field(six.text_type) - valueFrom = Field(EnvVarSource) + kubeletEndpoint = Field(DaemonEndpoint) -class DownwardAPIVolumeFile(Model): +class ContainerStateWaiting(Model): """ - DownwardAPIVolumeFile represents information to create the file containing the - pod field + ContainerStateWaiting is a waiting state of a container. """ - fieldRef = Field(ObjectFieldSelector) - mode = Field(int) - path = RequiredField(six.text_type) - resourceFieldRef = Field(ResourceFieldSelector) + message = Field(six.text_type) + reason = Field(six.text_type) -class DownwardAPIProjection(Model): +class ContainerStateTerminated(Model): """ - Represents downward API info for projecting into a projected volume. Note that - this is identical to a downwardAPI volume source without the default mode. + ContainerStateTerminated is a terminated state of a container. """ - items = ListField(DownwardAPIVolumeFile) + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) -class VolumeProjection(Model): +class ContainerStateRunning(Model): """ - Projection that may be projected along with other supported volume types + ContainerStateRunning is a running state of a container. """ - configMap = Field(ConfigMapProjection) - downwardAPI = Field(DownwardAPIProjection) - secret = Field(SecretProjection) + startedAt = Field(datetime.datetime) -class ProjectedVolumeSource(Model): +class ContainerState(Model): """ - Represents a projected volume source + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. """ - defaultMode = Field(int) - sources = ListField(VolumeProjection) + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) -class DownwardAPIVolumeSource(Model): +class ContainerStatus(Model): """ - DownwardAPIVolumeSource represents a volume containing downward API info. - Downward API volumes support ownership management and SELinux relabeling. + ContainerStatus contains details for the current status of this container. """ - defaultMode = Field(int) - items = ListField(DownwardAPIVolumeFile) + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) -class GitRepoVolumeSource(Model): +class PodStatus(Model): """ - Represents a volume that is populated with the contents of a git repository. - Git repo volumes do not support ownership management. Git repo volumes support - SELinux relabeling. + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. """ - directory = Field(six.text_type) - repository = RequiredField(six.text_type) - revision = Field(six.text_type) + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) -class SELinuxOptions(Model): +class ContainerPort(Model): """ - SELinuxOptions are the labels to be applied to the container + ContainerPort represents a network port in a single container. """ - level = Field(six.text_type) - role = Field(six.text_type) - type = Field(six.text_type) - user = Field(six.text_type) + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) -class PodSecurityContext(Model): +class ContainerImage(Model): """ - PodSecurityContext holds pod-level security attributes and common container - settings. Some fields are also present in container.securityContext. Field - values of container.securityContext take precedence over field values of - PodSecurityContext. + Describe a container image """ - fsGroup = Field(int) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) - supplementalGroups = ListField(int) + names = ListField(six.text_type) + sizeBytes = Field(int) -class SecurityContext(Model): +class ConfigMapKeySelector(Model): """ - SecurityContext holds security configuration that will be applied to a - container. Some fields are present in both SecurityContext and - PodSecurityContext. When both are set, the values in SecurityContext take - precedence. + Selects a key from a ConfigMap. """ - capabilities = Field(Capabilities) - privileged = Field(bool) - readOnlyRootFilesystem = Field(bool) - runAsNonRoot = Field(bool) - runAsUser = Field(int) - seLinuxOptions = Field(SELinuxOptions) + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) -class ContainerStateRunning(Model): +class EnvVarSource(Model): """ - ContainerStateRunning is a running state of a container. + EnvVarSource represents a source for the value of an EnvVar. """ - startedAt = Field(datetime.datetime) + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) -class ContainerState(Model): +class EnvVar(Model): """ - ContainerState holds a possible state of container. Only one of its members may - be specified. If none of them is specified, the default one is - ContainerStateWaiting. + EnvVar represents an environment variable present in a Container. """ - running = Field(ContainerStateRunning) - terminated = Field(ContainerStateTerminated) - waiting = Field(ContainerStateWaiting) + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) -class ContainerStatus(Model): +class ConfigMapEnvSource(Model): """ - ContainerStatus contains details for the current status of this container. + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. """ - containerID = Field(six.text_type) - image = RequiredField(six.text_type) - imageID = RequiredField(six.text_type) - lastState = Field(ContainerState) - name = RequiredField(six.text_type) - ready = RequiredField(bool) - restartCount = RequiredField(int) - state = Field(ContainerState) + name = Field(six.text_type) + optional = Field(bool) -class PodStatus(Model): +class EnvFromSource(Model): """ - PodStatus represents information about the status of a pod. Status may trail - the actual state of a system. + EnvFromSource represents the source of a set of ConfigMaps """ - conditions = ListField(PodCondition) - containerStatuses = ListField(ContainerStatus) - hostIP = Field(six.text_type) - initContainerStatuses = ListField(ContainerStatus) - message = Field(six.text_type) - phase = Field(six.text_type) - podIP = Field(six.text_type) - qosClass = Field(six.text_type) - reason = Field(six.text_type) - startTime = Field(datetime.datetime) + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) -class NFSVolumeSource(Model): +class ConfigMap(Model): """ - Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not - support ownership management or SELinux relabeling. + ConfigMap holds configuration data for pods to consume. """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") - path = RequiredField(six.text_type) - readOnly = Field(bool) - server = RequiredField(six.text_type) + data = Field(dict) + metadata = Field(ObjectMeta) -class Volume(Model): +class ConfigMapList(Model): """ - Volume represents a named volume in a pod that may be accessed by any container - in the pod. + ConfigMapList is a resource containing a list of ConfigMap objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - configMap = Field(ConfigMapVolumeSource) - downwardAPI = Field(DownwardAPIVolumeSource) - emptyDir = Field(EmptyDirVolumeSource) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - gitRepo = Field(GitRepoVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - name = RequiredField(six.text_type) - nfs = Field(NFSVolumeSource) - persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - projected = Field(ProjectedVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - secret = Field(SecretVolumeSource) - storageos = Field(StorageOSVolumeSource) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + items = ListField(ConfigMap) + metadata = Field(ListMeta) -class PersistentVolumeSpec(Model): +class ComponentCondition(Model): """ - PersistentVolumeSpec is the specification of a persistent volume. + Information about the condition of a component. """ - accessModes = ListField(six.text_type) - awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) - azureDisk = Field(AzureDiskVolumeSource) - azureFile = Field(AzureFileVolumeSource) - capacity = Field(dict) - cephfs = Field(CephFSVolumeSource) - cinder = Field(CinderVolumeSource) - claimRef = Field(ObjectReference) - fc = Field(FCVolumeSource) - flexVolume = Field(FlexVolumeSource) - flocker = Field(FlockerVolumeSource) - gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) - glusterfs = Field(GlusterfsVolumeSource) - hostPath = Field(HostPathVolumeSource) - iscsi = Field(ISCSIVolumeSource) - local = Field(LocalVolumeSource) - nfs = Field(NFSVolumeSource) - persistentVolumeReclaimPolicy = Field(six.text_type) - photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) - portworxVolume = Field(PortworxVolumeSource) - quobyte = Field(QuobyteVolumeSource) - rbd = Field(RBDVolumeSource) - scaleIO = Field(ScaleIOVolumeSource) - storageClassName = Field(six.text_type) - storageos = Field(StorageOSPersistentVolumeSource) - vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class PersistentVolume(Model): +class ComponentStatus(Model): """ - PersistentVolume (PV) is a storage resource provisioned by an administrator. It - is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage - /persistent-volumes + ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ class Meta: - create_url = "/api/v1/persistentvolumes" - delete_url = "/api/v1/persistentvolumes/{name}" - get_url = "/api/v1/persistentvolumes/{name}" - list_all_url = "/api/v1/persistentvolumes" - update_url = "/api/v1/persistentvolumes/{name}" - watch_url = "/api/v1/watch/persistentvolumes/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumes" + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolume") + kind = Field(six.text_type, "ComponentStatus") + conditions = ListField(ComponentCondition) metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeSpec) - status = ReadOnlyField(PersistentVolumeStatus) -class PersistentVolumeList(Model): +class ComponentStatusList(Model): """ - PersistentVolumeList is a list of PersistentVolume items. + Status of all the conditions for the component as a list of ComponentStatus + objects. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeList") + kind = Field(six.text_type, "ComponentStatusList") - items = ListField(PersistentVolume) + items = ListField(ComponentStatus) metadata = Field(ListMeta) -class ResourceRequirements(Model): +class CinderVolumeSource(Model): """ - ResourceRequirements describes the compute resource requirements. + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. """ - limits = Field(dict) - requests = Field(dict) + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) -class PersistentVolumeClaimSpec(Model): +class Capabilities(Model): """ - PersistentVolumeClaimSpec describes the common attributes of storage devices - and allows a Source for provider-specific attributes + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = RequiredField(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. """ - accessModes = ListField(six.text_type) - resources = Field(ResourceRequirements) - selector = Field(LabelSelector) - storageClassName = Field(six.text_type) - volumeName = Field(six.text_type) + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) -class PersistentVolumeClaim(Model): +class Node(Model): """ - PersistentVolumeClaim is a user's request for and claim to a persistent volume + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). """ class Meta: - create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - list_all_url = "/api/v1/persistentvolumeclaims" - list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" - update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" - watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaim") + kind = Field(six.text_type, "Node") metadata = Field(ObjectMeta) - spec = Field(PersistentVolumeClaimSpec) - status = ReadOnlyField(PersistentVolumeClaimStatus) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) -class PersistentVolumeClaimList(Model): +class NodeList(Model): """ - PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + NodeList is the whole list of all Nodes which have been registered with master. """ apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PersistentVolumeClaimList") + kind = Field(six.text_type, "NodeList") - items = ListField(PersistentVolumeClaim) + items = ListField(Node) metadata = Field(ListMeta) -class Container(Model): +class AWSElasticBlockStoreVolumeSource(Model): """ - A single application container that you want to run within a pod. + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. """ - args = ListField(six.text_type) - command = ListField(six.text_type) - env = ListField(EnvVar) - envFrom = ListField(EnvFromSource) - image = RequiredField(six.text_type) - imagePullPolicy = Field(six.text_type) - lifecycle = Field(Lifecycle) - livenessProbe = Field(Probe) + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) name = RequiredField(six.text_type) - ports = ListField(ContainerPort) - readinessProbe = Field(Probe) - resources = Field(ResourceRequirements) - securityContext = Field(SecurityContext) - stdin = Field(bool) - stdinOnce = Field(bool) - terminationMessagePath = Field(six.text_type) - terminationMessagePolicy = Field(six.text_type) - tty = Field(bool) - volumeMounts = ListField(VolumeMount) - workingDir = Field(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) class PodSpec(Model): @@ -1892,41 +1825,6 @@ class PodSpec(Model): volumes = ListField(Volume) -class Pod(Model): - """ - Pod is a collection of containers that can run on a host. This resource is - created by clients and scheduled onto hosts. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods" - delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" - get_url = "/api/v1/namespaces/{namespace}/pods/{name}" - list_all_url = "/api/v1/pods" - list_ns_url = "/api/v1/namespaces/{namespace}/pods" - update_url = "/api/v1/namespaces/{namespace}/pods/{name}" - watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" - watchlist_all_url = "/api/v1/watch/pods" - watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "Pod") - - metadata = Field(ObjectMeta) - spec = Field(PodSpec) - status = ReadOnlyField(PodStatus) - - -class PodList(Model): - """ - PodList is a list of Pods. - """ - apiVersion = Field(six.text_type, "v1") - kind = Field(six.text_type, "PodList") - - items = ListField(Pod) - metadata = Field(ListMeta) - - class PodTemplateSpec(Model): """ PodTemplateSpec describes the data a pod should have when created from a @@ -2014,3 +1912,105 @@ class PodTemplateList(Model): items = ListField(PodTemplate) metadata = Field(ListMeta) + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + local = Field(LocalVolumeSource) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py index a58cb3c..3fc3c07 100644 --- a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py @@ -17,57 +17,23 @@ ############################################################################### -class Rule(Model): - """ - Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to - make sure that all the tuple expansions are valid. - """ - - apiGroups = ListField(six.text_type) - apiVersions = ListField(six.text_type) - resources = ListField(six.text_type) - - -class Initializer(Model): +class ServiceReference(Model): """ - Initializer describes the name and the failure policy of an initializer, and - what resources it applies to. + ServiceReference holds a reference to Service.legacy.k8s.io """ - failurePolicy = Field(six.text_type) name = RequiredField(six.text_type) - rules = ListField(Rule) - - -class InitializerConfiguration(Model): - """ - InitializerConfiguration describes the configuration of initializers. - """ - class Meta: - create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" - delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" - get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" - list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" - update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" - watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" - watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - - apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") - kind = Field(six.text_type, "InitializerConfiguration") - - initializers = ListField(Initializer) - metadata = Field(ObjectMeta) + namespace = RequiredField(six.text_type) -class InitializerConfigurationList(Model): +class AdmissionHookClientConfig(Model): """ - InitializerConfigurationList is a list of InitializerConfiguration. + AdmissionHookClientConfig contains the information to make a TLS connection + with the webhook """ - apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") - kind = Field(six.text_type, "InitializerConfigurationList") - items = ListField(InitializerConfiguration) - metadata = Field(ListMeta) + caBundle = RequiredField(six.text_type) + service = RequiredField(ServiceReference) class RuleWithOperations(Model): @@ -82,25 +48,6 @@ class RuleWithOperations(Model): resources = ListField(six.text_type) -class ServiceReference(Model): - """ - ServiceReference holds a reference to Service.legacy.k8s.io - """ - - name = RequiredField(six.text_type) - namespace = RequiredField(six.text_type) - - -class AdmissionHookClientConfig(Model): - """ - AdmissionHookClientConfig contains the information to make a TLS connection - with the webhook - """ - - caBundle = RequiredField(six.text_type) - service = RequiredField(ServiceReference) - - class ExternalAdmissionHook(Model): """ ExternalAdmissionHook describes an external admission webhook and the resources @@ -144,3 +91,56 @@ class ExternalAdmissionHookConfigurationList(Model): items = ListField(ExternalAdmissionHookConfiguration) metadata = Field(ListMeta) + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py index 477491f..c49757c 100644 --- a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py @@ -21,6 +21,20 @@ ############################################################################### +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + class ScaleStatus(Model): """ ScaleStatus represents the current status of a scale subresource. @@ -31,6 +45,26 @@ class ScaleStatus(Model): targetSelector = Field(six.text_type) +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + class RollingUpdateStatefulSetStrategy(Model): """ RollingUpdateStatefulSetStrategy is used to communicate parameter for @@ -66,83 +100,6 @@ class StatefulSetSpec(Model): volumeClaimTemplates = ListField(PersistentVolumeClaim) -class ControllerRevision(Model): - """ - ControllerRevision implements an immutable snapshot of state data. Clients are - responsible for serializing and deserializing the objects that contain their - internal state. Once a ControllerRevision has been successfully created, it can - not be updated. The API Server will fail validation of all requests that - attempt to mutate the Data field. ControllerRevisions may, however, be deleted. - Note that, due to its use by both the DaemonSet and StatefulSet controllers for - update and rollback, this object is beta. However, it may be subject to name - and representation changes in future releases, and clients should not depend on - its stability. It is primarily for internal use by controllers. - """ - class Meta: - create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" - delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" - get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" - list_all_url = "/apis/apps/v1beta1/controllerrevisions" - list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" - update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" - watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" - watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" - watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "ControllerRevision") - - data = Field(RawExtension) - metadata = Field(ObjectMeta) - revision = RequiredField(int) - - -class ControllerRevisionList(Model): - """ - ControllerRevisionList is a resource containing a list of ControllerRevision - objects. - """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "ControllerRevisionList") - - items = ListField(ControllerRevision) - metadata = Field(ListMeta) - - -class RollbackConfig(Model): - """ - - """ - - revision = Field(int) - - -class DeploymentRollback(Model): - """ - DeploymentRollback stores the information required to rollback a deployment. - """ - apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - - name = RequiredField(six.text_type) - rollbackTo = RequiredField(RollbackConfig) - updatedAnnotations = Field(dict) - - -class StatefulSetStatus(Model): - """ - StatefulSetStatus represents the current state of a StatefulSet. - """ - - currentReplicas = Field(int) - currentRevision = Field(six.text_type) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = RequiredField(int) - updateRevision = Field(six.text_type) - updatedReplicas = Field(int) - - class StatefulSet(Model): """ StatefulSet represents a set of pods with consistent identities. Identities are @@ -183,24 +140,58 @@ class StatefulSetList(Model): metadata = Field(ListMeta) -class ScaleSpec(Model): +class RollingUpdateDeployment(Model): """ - ScaleSpec describes the attributes of a scale subresource + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. """ + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) -class Scale(Model): +class DeploymentRollback(Model): """ - Scale represents a scaling request for a resource. + DeploymentRollback stores the information required to rollback a deployment. """ apiVersion = Field(six.text_type, "apps/v1beta1") - kind = Field(six.text_type, "Scale") + kind = Field(six.text_type, "DeploymentRollback") - metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = ReadOnlyField(ScaleStatus) + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) class DeploymentCondition(Model): @@ -231,40 +222,6 @@ class DeploymentStatus(Model): updatedReplicas = Field(int) -class RollingUpdateDeployment(Model): - """ - Spec to control the desired behavior of rolling update. - """ - - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) - - -class DeploymentStrategy(Model): - """ - DeploymentStrategy describes how to replace existing pods with new ones. - """ - - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) - - -class DeploymentSpec(Model): - """ - DeploymentSpec is the specification of the desired behavior of the Deployment. - """ - - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = RequiredField(PodTemplateSpec) - - class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. @@ -298,3 +255,46 @@ class DeploymentList(Model): items = ListField(Deployment) metadata = Field(ListMeta) + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py index 24727d4..5db933a 100644 --- a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py @@ -17,14 +17,6 @@ ############################################################################### -class TokenReviewSpec(Model): - """ - TokenReviewSpec is a description of the token authentication request. - """ - - token = Field(six.text_type) - - class UserInfo(Model): """ UserInfo holds the information about the user needed to implement the user.Info @@ -47,6 +39,14 @@ class TokenReviewStatus(Model): user = Field(UserInfo) +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + class TokenReview(Model): """ TokenReview attempts to authenticate a token to a known user. Note: TokenReview diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py index 95519ed..8946499 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py @@ -17,14 +17,14 @@ ############################################################################### -class NonResourceAttributes(Model): +class SubjectAccessReviewStatus(Model): """ - NonResourceAttributes includes the authorization attributes available for non- - resource requests to the Authorizer interface + SubjectAccessReviewStatus """ - path = Field(six.text_type) - verb = Field(six.text_type) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class ResourceAttributes(Model): @@ -42,6 +42,16 @@ class ResourceAttributes(Model): version = Field(six.text_type) +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + class SubjectAccessReviewSpec(Model): """ SubjectAccessReviewSpec is a description of the access request. Exactly one of @@ -56,27 +66,6 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SelfSubjectAccessReviewSpec(Model): - """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set - """ - - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) - - -class SubjectAccessReviewStatus(Model): - """ - SubjectAccessReviewStatus - """ - - allowed = RequiredField(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) - - class SubjectAccessReview(Model): """ SubjectAccessReview checks whether or not a user or group can perform an @@ -93,37 +82,48 @@ class Meta: status = Field(SubjectAccessReviewStatus) -class SelfSubjectAccessReview(Model): +class LocalSubjectAccessReview(Model): """ - SelfSubjectAccessReview checks whether or the current user can perform an - action. Not filling in a spec.namespace means 'in all namespaces'. Self is a - special case, because users should always be able to check whether they can - perform an action + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. """ class Meta: - create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "SelfSubjectAccessReview") + kind = Field(six.text_type, "LocalSubjectAccessReview") metadata = Field(ObjectMeta) - spec = RequiredField(SelfSubjectAccessReviewSpec) + spec = RequiredField(SubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) -class LocalSubjectAccessReview(Model): +class SelfSubjectAccessReviewSpec(Model): """ - LocalSubjectAccessReview checks whether or not a user or group can perform an - action in a given namespace. Having a namespace scoped resource makes it much - easier to grant namespace scoped policy that includes permissions checking. + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action """ class Meta: - create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" apiVersion = Field(six.text_type, "authorization.k8s.io/v1") - kind = Field(six.text_type, "LocalSubjectAccessReview") + kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) - spec = RequiredField(SubjectAccessReviewSpec) + spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py index 49f9f44..c3b208e 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py @@ -17,14 +17,14 @@ ############################################################################### -class NonResourceAttributes(Model): +class SubjectAccessReviewStatus(Model): """ - NonResourceAttributes includes the authorization attributes available for non- - resource requests to the Authorizer interface + SubjectAccessReviewStatus """ - path = Field(six.text_type) - verb = Field(six.text_type) + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) class ResourceAttributes(Model): @@ -42,15 +42,14 @@ class ResourceAttributes(Model): version = Field(six.text_type) -class SelfSubjectAccessReviewSpec(Model): +class NonResourceAttributes(Model): """ - SelfSubjectAccessReviewSpec is a description of the access request. Exactly - one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes - must be set + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface """ - nonResourceAttributes = Field(NonResourceAttributes) - resourceAttributes = Field(ResourceAttributes) + path = Field(six.text_type) + verb = Field(six.text_type) class SubjectAccessReviewSpec(Model): @@ -67,14 +66,20 @@ class SubjectAccessReviewSpec(Model): user = Field(six.text_type) -class SubjectAccessReviewStatus(Model): +class SubjectAccessReview(Model): """ - SubjectAccessReviewStatus + SubjectAccessReview checks whether or not a user or group can perform an + action. """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") - allowed = RequiredField(bool) - evaluationError = Field(six.text_type) - reason = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) class LocalSubjectAccessReview(Model): @@ -94,20 +99,15 @@ class Meta: status = Field(SubjectAccessReviewStatus) -class SubjectAccessReview(Model): +class SelfSubjectAccessReviewSpec(Model): """ - SubjectAccessReview checks whether or not a user or group can perform an - action. + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set """ - class Meta: - create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - - apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") - kind = Field(six.text_type, "SubjectAccessReview") - metadata = Field(ObjectMeta) - spec = RequiredField(SubjectAccessReviewSpec) - status = Field(SubjectAccessReviewStatus) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) class SelfSubjectAccessReview(Model): diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py index b2f2fb1..fb3d234 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py @@ -19,41 +19,21 @@ ############################################################################### -class ScaleSpec(Model): - """ - ScaleSpec describes the attributes of a scale subresource. - """ - - replicas = Field(int) - - -class CrossVersionObjectReference(Model): - """ - CrossVersionObjectReference contains enough information to let you identify the - referred resource. - """ - - name = RequiredField(six.text_type) - - -class HorizontalPodAutoscalerSpec(Model): +class ScaleStatus(Model): """ - specification of a horizontal pod autoscaler. + ScaleStatus represents the current status of a scale subresource. """ - maxReplicas = RequiredField(int) - minReplicas = Field(int) - scaleTargetRef = RequiredField(CrossVersionObjectReference) - targetCPUUtilizationPercentage = Field(int) + replicas = RequiredField(int) + selector = Field(six.text_type) -class ScaleStatus(Model): +class ScaleSpec(Model): """ - ScaleStatus represents the current status of a scale subresource. + ScaleSpec describes the attributes of a scale subresource. """ - replicas = RequiredField(int) - selector = Field(six.text_type) + replicas = Field(int) class Scale(Model): @@ -80,6 +60,26 @@ class HorizontalPodAutoscalerStatus(Model): observedGeneration = Field(int) +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py index edf0c1a..22d0c4e 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py @@ -19,16 +19,6 @@ ############################################################################### -class PodsMetricStatus(Model): - """ - PodsMetricStatus indicates the current value of a metric describing each pod in - the current scale target (for example, transactions-processed-per-second). - """ - - currentAverageValue = RequiredField(six.text_type) - metricName = RequiredField(six.text_type) - - class ResourceMetricStatus(Model): """ ResourceMetricStatus indicates the current value of a resource metric known to @@ -43,17 +33,30 @@ class ResourceMetricStatus(Model): name = RequiredField(six.text_type) -class HorizontalPodAutoscalerCondition(Model): +class ResourceMetricSource(Model): """ - HorizontalPodAutoscalerCondition describes the state of a - HorizontalPodAutoscaler at a certain point. + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. """ - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) class PodsMetricSource(Model): @@ -67,6 +70,19 @@ class PodsMetricSource(Model): targetAverageValue = RequiredField(six.text_type) +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + class CrossVersionObjectReference(Model): """ CrossVersionObjectReference contains enough information to let you identify the @@ -123,22 +139,6 @@ class ObjectMetricSource(Model): targetValue = RequiredField(six.text_type) -class ResourceMetricSource(Model): - """ - ResourceMetricSource indicates how to scale on a resource metric known to - Kubernetes, as specified in requests and limits, describing each pod in the - current scale target (e.g. CPU or memory). The values will be averaged - together before being compared to the target. Such metrics are built in to - Kubernetes, and have special scaling options on top of those available to - normal per-pod metrics using the 'pods' source. Only one 'target' type should - be set. - """ - - name = RequiredField(six.text_type) - targetAverageUtilization = Field(int) - targetAverageValue = Field(six.text_type) - - class MetricSpec(Model): """ MetricSpec specifies how to scale based on a single metric (only `type` and one diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py index 83f8ce1..65985e7 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -60,15 +60,15 @@ class CronJob(Model): CronJob represents the configuration of a single cron job. """ class Meta: - create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" - delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - list_all_url = "/apis/batch/v2alpha1/cronjobs" - list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" - update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" - watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" - watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" - watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/scheduledjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/scheduledjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "ScheduledJob") diff --git a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py index aefcca4..09eaac3 100644 --- a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py @@ -20,121 +20,34 @@ ############################################################################### -class APIVersion(Model): +class ScaleStatus(Model): """ - An APIVersion represents a single concrete version of an object model. + represents the current status of a scale subresource. """ - name = Field(six.text_type) + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) -class ThirdPartyResource(Model): +class ScaleSpec(Model): """ - A ThirdPartyResource is a generic representation of a resource, it is used by - add-ons and plugins to add new resource types to the API. It consists of one - or more Versions of the api. + describes the attributes of a scale subresource """ - class Meta: - create_url = "/apis/extensions/v1beta1/thirdpartyresources" - delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" - update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" - watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResource") - description = Field(six.text_type) - metadata = Field(ObjectMeta) - versions = ListField(APIVersion) + replicas = Field(int) -class ThirdPartyResourceList(Model): +class Scale(Model): """ - ThirdPartyResourceList is a list of ThirdPartyResources. + represents a scaling request for a resource. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ThirdPartyResourceList") - - items = ListField(ThirdPartyResource) - metadata = Field(ListMeta) - - -class IngressStatus(Model): - """ - IngressStatus describe the current state of the Ingress. - """ - - loadBalancer = Field(LoadBalancerStatus) - - -class IDRange(Model): - """ - ID Range provides a min/max of an allowed range of IDs. - """ - - max = RequiredField(int) - min = RequiredField(int) - - -class RunAsUserStrategyOptions(Model): - """ - Run A sUser Strategy Options defines the strategy type and any options used to - create the strategy. - """ - - ranges = ListField(IDRange) - rule = RequiredField(six.text_type) - - -class SupplementalGroupsStrategyOptions(Model): - """ - SupplementalGroupsStrategyOptions defines the strategy type and options used to - create the strategy. - """ - - ranges = ListField(IDRange) - rule = Field(six.text_type) - - -class FSGroupStrategyOptions(Model): - """ - FSGroupStrategyOptions defines the strategy type and options used to create the - strategy. - """ - - ranges = ListField(IDRange) - rule = Field(six.text_type) - - -class DeploymentCondition(Model): - """ - DeploymentCondition describes the state of a deployment at a certain point. - """ - - lastTransitionTime = Field(datetime.datetime) - lastUpdateTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) - - -class DeploymentStatus(Model): - """ - DeploymentStatus is the most recently observed status of the Deployment. - """ + kind = Field(six.text_type, "Scale") - availableReplicas = Field(int) - collisionCount = Field(int) - conditions = ListField(DeploymentCondition) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = Field(int) - unavailableReplicas = Field(int) - updatedReplicas = Field(int) + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) class SELinuxStrategyOptions(Model): @@ -147,29 +60,22 @@ class SELinuxStrategyOptions(Model): seLinuxOptions = Field(SELinuxOptions) -class NetworkPolicyPort(Model): +class RollingUpdateDeployment(Model): """ - + Spec to control the desired behavior of rolling update. """ - port = Field(six.text_type, alt_type=int) - protocol = Field(six.text_type) + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) -class DaemonSetStatus(Model): +class DeploymentStrategy(Model): """ - DaemonSetStatus represents the current status of a daemon set. + DeploymentStrategy describes how to replace existing pods with new ones. """ - collisionCount = Field(int) - currentNumberScheduled = RequiredField(int) - desiredNumberScheduled = RequiredField(int) - numberAvailable = Field(int) - numberMisscheduled = RequiredField(int) - numberReady = RequiredField(int) - numberUnavailable = Field(int) - observedGeneration = Field(int) - updatedNumberScheduled = Field(int) + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) class RollingUpdateDaemonSet(Model): @@ -202,38 +108,40 @@ class DaemonSetSpec(Model): updateStrategy = Field(DaemonSetUpdateStrategy) -class DaemonSet(Model): - """ - DaemonSet represents the configuration of a daemon set. +class RollbackConfig(Model): """ - class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - list_all_url = "/apis/extensions/v1beta1/daemonsets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSet") + """ - metadata = Field(ObjectMeta) - spec = Field(DaemonSetSpec) - status = ReadOnlyField(DaemonSetStatus) + revision = Field(int) -class DaemonSetList(Model): +class DeploymentSpec(Model): """ - DaemonSetList is a collection of daemon sets. + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DeploymentRollback stores the information required to rollback a deployment. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DaemonSetList") + kind = Field(six.text_type, "DeploymentRollback") - items = ListField(DaemonSet) - metadata = Field(ListMeta) + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) class ReplicaSetSpec(Model): @@ -247,109 +155,150 @@ class ReplicaSetSpec(Model): template = Field(PodTemplateSpec) -class IngressTLS(Model): +class ReplicaSetCondition(Model): """ - IngressTLS describes the transport layer security associated with an Ingress. + ReplicaSetCondition describes the state of a replica set at a certain point. """ - hosts = ListField(six.text_type) - secretName = Field(six.text_type) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class RollingUpdateDeployment(Model): +class ReplicaSetStatus(Model): """ - Spec to control the desired behavior of rolling update. + ReplicaSetStatus represents the current status of a ReplicaSet. """ - maxSurge = Field(six.text_type, alt_type=int) - maxUnavailable = Field(six.text_type, alt_type=int) + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) -class DeploymentStrategy(Model): +class ReplicaSet(Model): """ - DeploymentStrategy describes how to replace existing pods with new ones. + ReplicaSet represents the configuration of a ReplicaSet. """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") - rollingUpdate = Field(RollingUpdateDeployment) - type = Field(six.text_type) + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) -class RollbackConfig(Model): +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): """ """ - revision = Field(int) + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) -class DeploymentRollback(Model): +class NetworkPolicyPeer(Model): """ - DeploymentRollback stores the information required to rollback a deployment. + """ - apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentRollback") - name = RequiredField(six.text_type) - rollbackTo = RequiredField(RollbackConfig) - updatedAnnotations = Field(dict) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) -class DeploymentSpec(Model): +class NetworkPolicyIngressRule(Model): """ - DeploymentSpec is the specification of the desired behavior of the Deployment. + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. """ - minReadySeconds = Field(int) - paused = Field(bool) - progressDeadlineSeconds = Field(int) - replicas = Field(int) - revisionHistoryLimit = Field(int) - rollbackTo = Field(RollbackConfig) - selector = Field(LabelSelector) - strategy = Field(DeploymentStrategy) - template = RequiredField(PodTemplateSpec) + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) -class Deployment(Model): +class NetworkPolicySpec(Model): + """ + + """ + + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + + +class NetworkPolicy(Model): """ - Deployment enables declarative updates for Pods and ReplicaSets. + NetworkPolicy describes what network traffic is allowed for a set of Pods """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - list_all_url = "/apis/extensions/v1beta1/deployments" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Deployment") + kind = Field(six.text_type, "NetworkPolicy") metadata = Field(ObjectMeta) - spec = Field(DeploymentSpec) - status = Field(DeploymentStatus) + spec = Field(NetworkPolicySpec) -class DeploymentList(Model): +class NetworkPolicyList(Model): """ - DeploymentList is a list of Deployments. + Network Policy List is a list of NetworkPolicy objects. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "DeploymentList") + kind = Field(six.text_type, "NetworkPolicyList") - items = ListField(Deployment) + items = ListField(NetworkPolicy) metadata = Field(ListMeta) -class ScaleSpec(Model): +class IngressTLS(Model): """ - describes the attributes of a scale subresource + IngressTLS describes the transport layer security associated with an Ingress. """ - replicas = Field(int) + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) class IngressBackend(Model): @@ -441,6 +390,45 @@ class IngressList(Model): metadata = Field(ListMeta) +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + class HostPortRange(Model): """ Host Port Range defines a range of host ports that will be enabled by a policy @@ -504,144 +492,156 @@ class PodSecurityPolicyList(Model): metadata = Field(ListMeta) -class NetworkPolicyPeer(Model): - """ - - """ - - namespaceSelector = Field(LabelSelector) - podSelector = Field(LabelSelector) - - -class NetworkPolicyIngressRule(Model): +class DeploymentCondition(Model): """ - This NetworkPolicyIngressRule matches traffic if and only if the traffic - matches both ports AND from. + DeploymentCondition describes the state of a deployment at a certain point. """ - _from = ListField(NetworkPolicyPeer) - ports = ListField(NetworkPolicyPort) + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) -class NetworkPolicySpec(Model): +class DeploymentStatus(Model): """ - + DeploymentStatus is the most recently observed status of the Deployment. """ - ingress = ListField(NetworkPolicyIngressRule) - podSelector = RequiredField(LabelSelector) + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) -class NetworkPolicy(Model): +class Deployment(Model): """ - NetworkPolicy describes what network traffic is allowed for a set of Pods + Deployment enables declarative updates for Pods and ReplicaSets. """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - list_all_url = "/apis/extensions/v1beta1/networkpolicies" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicy") + kind = Field(six.text_type, "Deployment") metadata = Field(ObjectMeta) - spec = Field(NetworkPolicySpec) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) -class NetworkPolicyList(Model): +class DeploymentList(Model): """ - Network Policy List is a list of NetworkPolicy objects. + DeploymentList is a list of Deployments. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "NetworkPolicyList") + kind = Field(six.text_type, "DeploymentList") - items = ListField(NetworkPolicy) + items = ListField(Deployment) metadata = Field(ListMeta) -class ScaleStatus(Model): +class DaemonSetStatus(Model): """ - represents the current status of a scale subresource. + DaemonSetStatus represents the current status of a daemon set. """ - replicas = RequiredField(int) - selector = Field(dict) - targetSelector = Field(six.text_type) + collisionCount = Field(int) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) -class Scale(Model): +class DaemonSet(Model): """ - represents a scaling request for a resource. + DaemonSet represents the configuration of a daemon set. """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "Scale") + kind = Field(six.text_type, "DaemonSet") metadata = Field(ObjectMeta) - spec = Field(ScaleSpec) - status = ReadOnlyField(ScaleStatus) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) -class ReplicaSetCondition(Model): +class DaemonSetList(Model): """ - ReplicaSetCondition describes the state of a replica set at a certain point. + DaemonSetList is a collection of daemon sets. """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") - lastTransitionTime = Field(datetime.datetime) - message = Field(six.text_type) - reason = Field(six.text_type) - status = RequiredField(six.text_type) - type = RequiredField(six.text_type) + items = ListField(DaemonSet) + metadata = Field(ListMeta) -class ReplicaSetStatus(Model): +class APIVersion(Model): """ - ReplicaSetStatus represents the current status of a ReplicaSet. + An APIVersion represents a single concrete version of an object model. """ - availableReplicas = Field(int) - conditions = ListField(ReplicaSetCondition) - fullyLabeledReplicas = Field(int) - observedGeneration = Field(int) - readyReplicas = Field(int) - replicas = RequiredField(int) + name = Field(six.text_type) -class ReplicaSet(Model): +class ThirdPartyResource(Model): """ - ReplicaSet represents the configuration of a ReplicaSet. + A ThirdPartyResource is a generic representation of a resource, it is used by + add-ons and plugins to add new resource types to the API. It consists of one + or more Versions of the api. """ class Meta: - create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" - delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - list_all_url = "/apis/extensions/v1beta1/replicasets" - list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" - update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" - watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" - watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" - watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + create_url = "/apis/extensions/v1beta1/thirdpartyresources" + delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + get_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + list_all_url = "/apis/extensions/v1beta1/thirdpartyresources" + update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" + watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ReplicaSet") + kind = Field(six.text_type, "ThirdPartyResource") + description = Field(six.text_type) metadata = Field(ObjectMeta) - spec = Field(ReplicaSetSpec) - status = ReadOnlyField(ReplicaSetStatus) + versions = ListField(APIVersion) -class ReplicaSetList(Model): +class ThirdPartyResourceList(Model): """ - ReplicaSetList is a collection of ReplicaSets. + ThirdPartyResourceList is a list of ThirdPartyResources. """ apiVersion = Field(six.text_type, "extensions/v1beta1") - kind = Field(six.text_type, "ReplicaSetList") + kind = Field(six.text_type, "ThirdPartyResourceList") - items = ListField(ReplicaSet) + items = ListField(ThirdPartyResource) metadata = Field(ListMeta) diff --git a/k8s/models/v1_7/kubernetes/apis/networking/v1.py b/k8s/models/v1_7/kubernetes/apis/networking/v1.py index 0004eb7..cb55dd1 100644 --- a/k8s/models/v1_7/kubernetes/apis/networking/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/networking/v1.py @@ -17,23 +17,23 @@ ############################################################################### -class NetworkPolicyPeer(Model): +class NetworkPolicyPort(Model): """ - NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its - fields must be specified. + NetworkPolicyPort describes a port to allow traffic on """ - namespaceSelector = Field(LabelSelector) - podSelector = Field(LabelSelector) + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) -class NetworkPolicyPort(Model): +class NetworkPolicyPeer(Model): """ - NetworkPolicyPort describes a port to allow traffic on + NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its + fields must be specified. """ - port = Field(six.text_type, alt_type=int) - protocol = Field(six.text_type) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) class NetworkPolicyIngressRule(Model): diff --git a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py index dae59ba..c200a84 100644 --- a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py @@ -17,22 +17,6 @@ ############################################################################### -class Eviction(Model): - """ - Eviction evicts a pod from its node subject to certain policies and safety - constraints. This is a subresource of Pod. A request to cause such an eviction - is created by POSTing to .../pods//evictions. - """ - class Meta: - create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - - apiVersion = Field(six.text_type, "policy/v1beta1") - kind = Field(six.text_type, "Eviction") - - deleteOptions = Field(DeleteOptions) - metadata = Field(ObjectMeta) - - class PodDisruptionBudgetStatus(Model): """ PodDisruptionBudgetStatus represents information about the status of a @@ -91,3 +75,19 @@ class PodDisruptionBudgetList(Model): items = ListField(PodDisruptionBudget) metadata = Field(ListMeta) + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + From b1c7f91a3f9123e8d31b2e67ce7f37e6f1745f4b Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 14:25:14 +0100 Subject: [PATCH 17/25] Ignore a couple more special paths --- bin/generator.py | 2 +- k8s/models/v1_6/kubernetes/api/v1.py | 1 - .../v1_6/kubernetes/apis/batch/v2alpha1.py | 18 +++++++++--------- .../kubernetes/apis/certificates/v1beta1.py | 1 - k8s/models/v1_7/kubernetes/api/v1.py | 1 - .../v1_7/kubernetes/apis/batch/v2alpha1.py | 18 +++++++++--------- .../kubernetes/apis/certificates/v1beta1.py | 1 - 7 files changed, 19 insertions(+), 23 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 307fa20..033cf67 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -323,7 +323,7 @@ def _parse_operations(self): @staticmethod def _should_ignore_path(path): last = posixpath.split(path)[-1] - return last in ("status", "scale", "rollback", "bindings", "log") + return last in ("status", "scale", "rollback", "bindings", "log", "approval", "finalize") @staticmethod def _should_ignore_method(method): diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py index ae26983..a5d7f9b 100644 --- a/k8s/models/v1_6/kubernetes/api/v1.py +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -660,7 +660,6 @@ class Meta: get_url = "/api/v1/namespaces/{name}" list_all_url = "/api/v1/namespaces" update_url = "/api/v1/namespaces/{name}" - update_url = "/api/v1/namespaces/{name}/finalize" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py index ad9baf8..642aa5a 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -60,15 +60,15 @@ class CronJob(Model): CronJob represents the configuration of a single cron job. """ class Meta: - create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" - delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - list_all_url = "/apis/batch/v2alpha1/scheduledjobs" - list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" - update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}" - watchlist_all_url = "/apis/batch/v2alpha1/watch/scheduledjobs" - watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs" + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "ScheduledJob") diff --git a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py index 58fb073..f8bd1e0 100644 --- a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py @@ -63,7 +63,6 @@ class Meta: delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" - update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py index b74a805..85cbd03 100644 --- a/k8s/models/v1_7/kubernetes/api/v1.py +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -680,7 +680,6 @@ class Meta: get_url = "/api/v1/namespaces/{name}" list_all_url = "/api/v1/namespaces" update_url = "/api/v1/namespaces/{name}" - update_url = "/api/v1/namespaces/{name}/finalize" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py index 65985e7..83f8ce1 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -60,15 +60,15 @@ class CronJob(Model): CronJob represents the configuration of a single cron job. """ class Meta: - create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" - delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - list_all_url = "/apis/batch/v2alpha1/scheduledjobs" - list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs" - update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/scheduledjobs/{name}" - watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs/{name}" - watchlist_all_url = "/apis/batch/v2alpha1/watch/scheduledjobs" - watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/scheduledjobs" + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "ScheduledJob") diff --git a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py index 7a8cc63..b112d8a 100644 --- a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py @@ -64,7 +64,6 @@ class Meta: get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" - update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}/approval" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" From fc5dd60d47eeb9d38cbc635b1b91d079abb143da Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 14:50:36 +0100 Subject: [PATCH 18/25] Always pick the first GVK listed, and only that --- bin/generator.py | 1 + k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py | 4 ++-- k8s/models/v1_7/apimachinery/apis/meta/v1.py | 4 ++-- k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py | 4 ++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index 033cf67..42575d2 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -147,6 +147,7 @@ def _parse_models(self): for x in item.get("x-kubernetes-group-version-kind", []): x = {k.lower(): v for k, v in x.items()} gvks.append(GVK(**x)) + gvks = gvks[:1] fields = [] required_fields = item.get("required", []) for field_name, property in item.get("properties", {}).items(): diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py index 642aa5a..835b3bf 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -71,7 +71,7 @@ class Meta: watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") - kind = Field(six.text_type, "ScheduledJob") + kind = Field(six.text_type, "CronJob") metadata = Field(ObjectMeta) spec = Field(CronJobSpec) @@ -83,7 +83,7 @@ class CronJobList(Model): CronJobList is a collection of cron jobs. """ apiVersion = Field(six.text_type, "batch/v2alpha1") - kind = Field(six.text_type, "ScheduledJobList") + kind = Field(six.text_type, "CronJobList") items = ListField(CronJob) metadata = Field(ListMeta) diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py index b958f4e..2005c23 100644 --- a/k8s/models/v1_7/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -23,7 +23,7 @@ class WatchEvent(Model): """ Event represents a single event to a watched resource. """ - apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "WatchEvent") object = RequiredField(RawExtension) @@ -92,7 +92,7 @@ class DeleteOptions(Model): """ DeleteOptions may be provided when deleting an API object. """ - apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "DeleteOptions") gracePeriodSeconds = Field(int) diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py index 83f8ce1..fb38527 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -71,7 +71,7 @@ class Meta: watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" apiVersion = Field(six.text_type, "batch/v2alpha1") - kind = Field(six.text_type, "ScheduledJob") + kind = Field(six.text_type, "CronJob") metadata = Field(ObjectMeta) spec = Field(CronJobSpec) @@ -83,7 +83,7 @@ class CronJobList(Model): CronJobList is a collection of cron jobs. """ apiVersion = Field(six.text_type, "batch/v2alpha1") - kind = Field(six.text_type, "ScheduledJobList") + kind = Field(six.text_type, "CronJobList") items = ListField(CronJob) metadata = Field(ListMeta) From 13a39d05b6d4faea4de96df6a6159884454bb011 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Wed, 9 Jan 2019 15:19:14 +0100 Subject: [PATCH 19/25] Clean away empty packages --- bin/generator.py | 6 +- k8s/models/v1_8/__init__.py | 1 + k8s/models/v1_8/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 145 ++ k8s/models/v1_8/api/apps/__init__.py | 1 + k8s/models/v1_8/api/apps/v1beta1.py | 308 +++ k8s/models/v1_8/api/apps/v1beta2.py | 430 ++++ .../v1_8/api/authentication/__init__.py | 1 + k8s/models/v1_8/api/authentication/v1.py | 65 + k8s/models/v1_8/api/authentication/v1beta1.py | 65 + k8s/models/v1_8/api/authorization/__init__.py | 1 + k8s/models/v1_8/api/authorization/v1.py | 198 ++ k8s/models/v1_8/api/authorization/v1beta1.py | 198 ++ k8s/models/v1_8/api/autoscaling/__init__.py | 1 + k8s/models/v1_8/api/autoscaling/v1.py | 115 + k8s/models/v1_8/api/autoscaling/v2beta1.py | 200 ++ k8s/models/v1_8/api/batch/__init__.py | 1 + k8s/models/v1_8/api/batch/v1.py | 95 + k8s/models/v1_8/api/batch/v1beta1.py | 90 + k8s/models/v1_8/api/batch/v2alpha1.py | 90 + k8s/models/v1_8/api/certificates/__init__.py | 1 + k8s/models/v1_8/api/certificates/v1beta1.py | 87 + k8s/models/v1_8/api/core/__init__.py | 1 + k8s/models/v1_8/api/core/v1.py | 2121 +++++++++++++++++ k8s/models/v1_8/api/extensions/__init__.py | 1 + k8s/models/v1_8/api/extensions/v1beta1.py | 649 +++++ k8s/models/v1_8/api/networking/__init__.py | 1 + k8s/models/v1_8/api/networking/v1.py | 115 + k8s/models/v1_8/api/policy/__init__.py | 1 + k8s/models/v1_8/api/policy/v1beta1.py | 93 + k8s/models/v1_8/api/rbac/__init__.py | 1 + k8s/models/v1_8/api/rbac/v1.py | 191 ++ k8s/models/v1_8/api/rbac/v1alpha1.py | 190 ++ k8s/models/v1_8/api/rbac/v1beta1.py | 191 ++ k8s/models/v1_8/api/scheduling/__init__.py | 1 + k8s/models/v1_8/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_8/api/settings/__init__.py | 1 + k8s/models/v1_8/api/settings/v1alpha1.py | 65 + k8s/models/v1_8/api/storage/__init__.py | 1 + k8s/models/v1_8/api/storage/v1.py | 58 + k8s/models/v1_8/api/storage/v1beta1.py | 58 + .../v1_8/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 73 + k8s/models/v1_8/apimachinery/__init__.py | 1 + k8s/models/v1_8/apimachinery/apis/__init__.py | 1 + .../v1_8/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_8/apimachinery/apis/meta/v1.py | 268 +++ k8s/models/v1_8/apimachinery/runtime.py | 66 + k8s/models/v1_8/apimachinery/version.py | 34 + k8s/models/v1_8/kube_aggregator/__init__.py | 1 + .../v1_8/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1beta1.py | 85 + 56 files changed, 6426 insertions(+), 1 deletion(-) create mode 100644 k8s/models/v1_8/__init__.py create mode 100644 k8s/models/v1_8/api/__init__.py create mode 100644 k8s/models/v1_8/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_8/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_8/api/apps/__init__.py create mode 100644 k8s/models/v1_8/api/apps/v1beta1.py create mode 100644 k8s/models/v1_8/api/apps/v1beta2.py create mode 100644 k8s/models/v1_8/api/authentication/__init__.py create mode 100644 k8s/models/v1_8/api/authentication/v1.py create mode 100644 k8s/models/v1_8/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_8/api/authorization/__init__.py create mode 100644 k8s/models/v1_8/api/authorization/v1.py create mode 100644 k8s/models/v1_8/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_8/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_8/api/autoscaling/v1.py create mode 100644 k8s/models/v1_8/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_8/api/batch/__init__.py create mode 100644 k8s/models/v1_8/api/batch/v1.py create mode 100644 k8s/models/v1_8/api/batch/v1beta1.py create mode 100644 k8s/models/v1_8/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_8/api/certificates/__init__.py create mode 100644 k8s/models/v1_8/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_8/api/core/__init__.py create mode 100644 k8s/models/v1_8/api/core/v1.py create mode 100644 k8s/models/v1_8/api/extensions/__init__.py create mode 100644 k8s/models/v1_8/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_8/api/networking/__init__.py create mode 100644 k8s/models/v1_8/api/networking/v1.py create mode 100644 k8s/models/v1_8/api/policy/__init__.py create mode 100644 k8s/models/v1_8/api/policy/v1beta1.py create mode 100644 k8s/models/v1_8/api/rbac/__init__.py create mode 100644 k8s/models/v1_8/api/rbac/v1.py create mode 100644 k8s/models/v1_8/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_8/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_8/api/scheduling/__init__.py create mode 100644 k8s/models/v1_8/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_8/api/settings/__init__.py create mode 100644 k8s/models/v1_8/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_8/api/storage/__init__.py create mode 100644 k8s/models/v1_8/api/storage/v1.py create mode 100644 k8s/models/v1_8/api/storage/v1beta1.py create mode 100644 k8s/models/v1_8/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_8/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_8/apimachinery/__init__.py create mode 100644 k8s/models/v1_8/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_8/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_8/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_8/apimachinery/runtime.py create mode 100644 k8s/models/v1_8/apimachinery/version.py create mode 100644 k8s/models/v1_8/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_8/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_8/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py diff --git a/bin/generator.py b/bin/generator.py index 42575d2..f2179da 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -15,7 +15,7 @@ from jinja2 import Environment, FileSystemLoader URL_TEMPLATE = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.{}/api/openapi-spec/swagger.json" -VERSION_RANGE = (6, 8) +VERSION_RANGE = (6, 9) HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -382,6 +382,10 @@ def generate(self): print("Generating models in {}".format(self._output_dir)) for package in self._packages: self._generate_package(package) + for root, dirs, files in os.walk(self._output_dir, topdown=False): + current_contents = os.listdir(root) + if len(current_contents) == 0: + os.rmdir(root) for root, dirs, files in os.walk(self._output_dir): if "__init__.py" in files: continue diff --git a/k8s/models/v1_8/__init__.py b/k8s/models/v1_8/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/__init__.py b/k8s/models/v1_8/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/admissionregistration/__init__.py b/k8s/models/v1_8/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/admissionregistration/v1alpha1.py b/k8s/models/v1_8/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..f7c0fb4 --- /dev/null +++ b/k8s/models/v1_8/api/admissionregistration/v1alpha1.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + + +class AdmissionHookClientConfig(Model): + """ + AdmissionHookClientConfig contains the information to make a TLS connection + with the webhook + """ + + caBundle = RequiredField(six.text_type) + service = RequiredField(ServiceReference) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class ExternalAdmissionHook(Model): + """ + ExternalAdmissionHook describes an external admission webhook and the resources + and operations it applies to. + """ + + clientConfig = RequiredField(AdmissionHookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + rules = ListField(RuleWithOperations) + + +class ExternalAdmissionHookConfiguration(Model): + """ + ExternalAdmissionHookConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "ExternalAdmissionHookConfiguration") + + externalAdmissionHooks = ListField(ExternalAdmissionHook) + metadata = Field(ObjectMeta) + + +class ExternalAdmissionHookConfigurationList(Model): + """ + ExternalAdmissionHookConfigurationList is a list of + ExternalAdmissionHookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "ExternalAdmissionHookConfigurationList") + + items = ListField(ExternalAdmissionHookConfiguration) + metadata = Field(ListMeta) + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/apps/__init__.py b/k8s/models/v1_8/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/apps/v1beta1.py b/k8s/models/v1_8/api/apps/v1beta1.py new file mode 100644 index 0000000..804c869 --- /dev/null +++ b/k8s/models/v1_8/api/apps/v1beta1.py @@ -0,0 +1,308 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_8.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/apps/v1beta2.py b/k8s/models/v1_8/api/apps/v1beta2.py new file mode 100644 index 0000000..d3c72bb --- /dev/null +++ b/k8s/models/v1_8/api/apps/v1beta2.py @@ -0,0 +1,430 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_8.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet represents the configuration of a ReplicaSet. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/authentication/__init__.py b/k8s/models/v1_8/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/authentication/v1.py b/k8s/models/v1_8/api/authentication/v1.py new file mode 100644 index 0000000..23963d3 --- /dev/null +++ b/k8s/models/v1_8/api/authentication/v1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_8/api/authentication/v1beta1.py b/k8s/models/v1_8/api/authentication/v1beta1.py new file mode 100644 index 0000000..dce6f47 --- /dev/null +++ b/k8s/models/v1_8/api/authentication/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_8/api/authorization/__init__.py b/k8s/models/v1_8/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/authorization/v1.py b/k8s/models/v1_8/api/authorization/v1.py new file mode 100644 index 0000000..0522873 --- /dev/null +++ b/k8s/models/v1_8/api/authorization/v1.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_8/api/authorization/v1beta1.py b/k8s/models/v1_8/api/authorization/v1beta1.py new file mode 100644 index 0000000..2744fe9 --- /dev/null +++ b/k8s/models/v1_8/api/authorization/v1beta1.py @@ -0,0 +1,198 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_8/api/autoscaling/__init__.py b/k8s/models/v1_8/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/autoscaling/v1.py b/k8s/models/v1_8/api/autoscaling/v1.py new file mode 100644 index 0000000..1dc4c72 --- /dev/null +++ b/k8s/models/v1_8/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/autoscaling/v2beta1.py b/k8s/models/v1_8/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..c3bf064 --- /dev/null +++ b/k8s/models/v1_8/api/autoscaling/v2beta1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/batch/__init__.py b/k8s/models/v1_8/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/batch/v1.py b/k8s/models/v1_8/api/batch/v1.py new file mode 100644 index 0000000..bdc492f --- /dev/null +++ b/k8s/models/v1_8/api/batch/v1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.api.core.v1 import PodTemplateSpec +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/batch/v1beta1.py b/k8s/models/v1_8/api/batch/v1beta1.py new file mode 100644 index 0000000..577ed6e --- /dev/null +++ b/k8s/models/v1_8/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.api.batch.v1 import JobSpec +from k8s.models.v1_8.api.core.v1 import ObjectReference +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/batch/v2alpha1.py b/k8s/models/v1_8/api/batch/v2alpha1.py new file mode 100644 index 0000000..45c9ac9 --- /dev/null +++ b/k8s/models/v1_8/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.api.batch.v1 import JobSpec +from k8s.models.v1_8.api.core.v1 import ObjectReference +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/certificates/__init__.py b/k8s/models/v1_8/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/certificates/v1beta1.py b/k8s/models/v1_8/api/certificates/v1beta1.py new file mode 100644 index 0000000..364bc3b --- /dev/null +++ b/k8s/models/v1_8/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/core/__init__.py b/k8s/models/v1_8/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/core/v1.py b/k8s/models/v1_8/api/core/v1.py new file mode 100644 index 0000000..4adc7b3 --- /dev/null +++ b/k8s/models/v1_8/api/core/v1.py @@ -0,0 +1,2121 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopes = ListField(six.text_type) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key tches that of any node on which + a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = Field(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeConfigSource") + + configMapRef = Field(ObjectReference) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity + """ + + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. This is an alpha feature and may change in future. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + count = Field(int) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/extensions/__init__.py b/k8s/models/v1_8/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/extensions/v1beta1.py b/k8s/models/v1_8/api/extensions/v1beta1.py new file mode 100644 index 0000000..27224f1 --- /dev/null +++ b/k8s/models/v1_8/api/extensions/v1beta1.py @@ -0,0 +1,649 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + represents the configuration of a ReplicaSet. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + This NetworkPolicyIngressRule matches traffic if and only if the traffic + matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + Network Policy List is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + defines the host volume conditions that will be enabled by a policy for pods to + use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedHostPaths = ListField(AllowedHostPath) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/networking/__init__.py b/k8s/models/v1_8/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/networking/v1.py b/k8s/models/v1_8/api/networking/v1.py new file mode 100644 index 0000000..93d7a98 --- /dev/null +++ b/k8s/models/v1_8/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its + fields must be specified. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/policy/__init__.py b/k8s/models/v1_8/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/policy/v1beta1.py b/k8s/models/v1_8/api/policy/v1beta1.py new file mode 100644 index 0000000..6fc55ec --- /dev/null +++ b/k8s/models/v1_8/api/policy/v1beta1.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + diff --git a/k8s/models/v1_8/api/rbac/__init__.py b/k8s/models/v1_8/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/rbac/v1.py b/k8s/models/v1_8/api/rbac/v1.py new file mode 100644 index 0000000..c104cef --- /dev/null +++ b/k8s/models/v1_8/api/rbac/v1.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/rbac/v1alpha1.py b/k8s/models/v1_8/api/rbac/v1alpha1.py new file mode 100644 index 0000000..230ebca --- /dev/null +++ b/k8s/models/v1_8/api/rbac/v1alpha1.py @@ -0,0 +1,190 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/rbac/v1beta1.py b/k8s/models/v1_8/api/rbac/v1beta1.py new file mode 100644 index 0000000..93e4f8b --- /dev/null +++ b/k8s/models/v1_8/api/rbac/v1beta1.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/scheduling/__init__.py b/k8s/models/v1_8/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/scheduling/v1alpha1.py b/k8s/models/v1_8/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..46da6f8 --- /dev/null +++ b/k8s/models/v1_8/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/settings/__init__.py b/k8s/models/v1_8/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/settings/v1alpha1.py b/k8s/models/v1_8/api/settings/v1alpha1.py new file mode 100644 index 0000000..e59e9ad --- /dev/null +++ b/k8s/models/v1_8/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_8.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_8.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/storage/__init__.py b/k8s/models/v1_8/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/api/storage/v1.py b/k8s/models/v1_8/api/storage/v1.py new file mode 100644 index 0000000..0c0b898 --- /dev/null +++ b/k8s/models/v1_8/api/storage/v1.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/api/storage/v1beta1.py b/k8s/models/v1_8/api/storage/v1beta1.py new file mode 100644 index 0000000..60da32f --- /dev/null +++ b/k8s/models/v1_8/api/storage/v1beta1.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/apiextensions_apiserver/__init__.py b/k8s/models/v1_8/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_8/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..385d1f8 --- /dev/null +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JSON(Model): + """ + JSON represents any valid JSON value. These types are supported: bool, int64, + float64, string, []interface{}, map[string]interface{} and nil. + """ + + Raw = RequiredField(six.text_type) + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + diff --git a/k8s/models/v1_8/apimachinery/__init__.py b/k8s/models/v1_8/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apimachinery/apis/__init__.py b/k8s/models/v1_8/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apimachinery/apis/meta/__init__.py b/k8s/models/v1_8/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/apimachinery/apis/meta/v1.py b/k8s/models/v1_8/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..b9fce77 --- /dev/null +++ b/k8s/models/v1_8/apimachinery/apis/meta/v1.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_8.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_8/apimachinery/runtime.py b/k8s/models/v1_8/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_8/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_8/apimachinery/version.py b/k8s/models/v1_8/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_8/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_8/kube_aggregator/__init__.py b/k8s/models/v1_8/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/kube_aggregator/apis/__init__.py b/k8s/models/v1_8/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..5a92bf2 --- /dev/null +++ b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,85 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = RequiredField(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + + items = ListField(APIService) + metadata = Field(ListMeta) + From 19ab4391d533986422295a3902422d4a34905408 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Thu, 10 Jan 2019 10:30:09 +0100 Subject: [PATCH 20/25] Fix missing GVKs and break cycle that made some models go lost in sort --- bin/generator.py | 78 ++++++++++++++++--- k8s/models/v1_6/apimachinery/apis/meta/v1.py | 14 ++++ .../apis/apiregistration/v1beta1.py | 13 ++++ .../apis/apiextensions/v1beta1.py | 64 ++++++++++++--- .../apis/apiregistration/v1beta1.py | 13 ++++ 5 files changed, 161 insertions(+), 21 deletions(-) diff --git a/bin/generator.py b/bin/generator.py index f2179da..6929762 100644 --- a/bin/generator.py +++ b/bin/generator.py @@ -15,7 +15,7 @@ from jinja2 import Environment, FileSystemLoader URL_TEMPLATE = "https://raw.githubusercontent.com/kubernetes/kubernetes/release-1.{}/api/openapi-spec/swagger.json" -VERSION_RANGE = (6, 9) +VERSION_RANGE = (6, 14) HTTP_CLIENT_SESSION = CacheControl(requests.session(), cache=FileCache(appdirs.user_cache_dir("k8s-generator"))) TYPE_MAPPING = { "integer": "int", @@ -38,6 +38,7 @@ REF_PATTERN = re.compile(r"io\.k8s\.(.+)") OPERATION_ID_TO_ACTION = {} OPERATION_ID_TO_GVK = {} +MODEL_REF_TO_GVK = {} PYTHON2_KEYWORDS = ['and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'with', 'yield'] @@ -83,6 +84,9 @@ def __init__(self, ref, definition, operations=[]): def name(self): return self.definition.name + def __repr__(self): + return "Model(ref={})".format(self.ref) + class Package(namedtuple("Package", ("ref", "modules"))): @property @@ -96,7 +100,20 @@ def names(self): return sorted(m.definition.name for m in self.models) +@total_ordering +class Node(namedtuple("Node", ("model", "dependants", "dependencies"))): + def __eq__(self, other): + return self.model == other.model + + def __lt__(self, other): + return self.model < other.model + + def __hash__(self): + return hash(self.model) + + def shorten_ref(id): + id = id.replace("-", "_") m = REF_PATTERN.search(id) if not m: raise RuntimeError("Invalid id: {}".format(id)) @@ -113,6 +130,8 @@ class PackageParser(object): shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.CustomResourceSubresourceStatus"): Primitive("object"), # This might not be the right thing to do, but the spec is unclear shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSON"): Primitive("object"), + shorten_ref("io.k8s.apiextensions-apiserver.pkg.apis.apiextensions.v1beta1.JSONSchemaProps"): + Primitive("object"), } _UNION_TYPES = { shorten_ref("io.k8s.apimachinery.pkg.util.intstr.IntOrString"): (Primitive("string"), Primitive("integer")), @@ -140,13 +159,22 @@ def parse(self): def _parse_models(self): for id, item in self._spec.items(): id = shorten_ref(id) + if id in self._SPECIAL_TYPES: + print("Model {} is a special type, skipping".format(id)) + continue + if id in self._UNION_TYPES: + print("Model {} is a union type, skipping".format(id)) + continue package_ref, module_name, def_name = _split_ref(id) package = self.get_package(package_ref) module = self.get_module(package, module_name) + model_ref = _make_ref(package.ref, module.name, def_name) gvks = [] for x in item.get("x-kubernetes-group-version-kind", []): x = {k.lower(): v for k, v in x.items()} gvks.append(GVK(**x)) + if not gvks and model_ref in MODEL_REF_TO_GVK: + gvks = [MODEL_REF_TO_GVK[model_ref]] gvks = gvks[:1] fields = [] required_fields = item.get("required", []) @@ -156,11 +184,12 @@ def _parse_models(self): print("Model {}.{}.{} has no fields, skipping".format(package_ref, module_name, def_name)) continue definition = Definition(def_name, item.get("description", ""), fields, gvks) - model = Model(_make_ref(package.ref, module.name, def_name), definition) + model = Model(model_ref, definition) module.models.append(model) self._models[model.ref] = model for gvk in gvks: self._gvk_lookup[gvk] = model + MODEL_REF_TO_GVK[model_ref] = gvk print("Completed parse. Parsed {} packages, {} modules, {} models and {} GVKs.".format(len(self._packages), len(self._modules), len(self._models), @@ -264,28 +293,53 @@ def _sort(self): def _sort_models(self, models): """We need to make sure that any model that references an other model comes later in the list""" - Node = namedtuple("Node", ("model", "dependants", "dependencies")) nodes = {} for model in models: - node = nodes.setdefault(model.ref, Node(model, [], [])) + nodes[model.ref] = Node(model, [], []) + for node in sorted(nodes.values()): + model = node.model for field in model.definition.fields: if isinstance(field.type, Model) and field.type.parent_ref == model.parent_ref: - dep = nodes.setdefault(field.type.ref, Node(field.type, [], [])) + dep = nodes[field.type.ref] node.dependencies.append(dep) - for node in sorted(nodes.values()): - for dep in node.dependencies: - dep.dependants.append(node) + dep.dependants.append(node) + self._cycle_check(nodes.values()) top_nodes = [n for n in nodes.values() if len(n.dependencies) == 0] top_nodes.sort() - models = [] + sorted_models = [] while top_nodes: top_node = top_nodes.pop() - models.append(top_node.model) + sorted_models.append(top_node.model) for dep in top_node.dependants: dep.dependencies.remove(top_node) if len(dep.dependencies) == 0: top_nodes.append(dep) - return models + if len(models) != len(sorted_models): + print("Lost models while sorting!!!\n=== Input: {}\n=== Output: {}".format(models, sorted_models)) + return sorted_models + + def _cycle_check(self, nodes): + visited = defaultdict(bool) + stack = defaultdict(bool) + for n in nodes: + if not visited[n]: + result = self._cycle_check_util(n, visited, stack) + if result: + print("Graph has a cycle!!! Detected at {}".format(result)) + break + + def _cycle_check_util(self, v, visited, stack): + visited[v] = True + stack[v] = True + for dep in v.dependencies: + if not visited[dep]: + result = self._cycle_check_util(dep, visited, stack) + if result: + return result + elif stack[dep]: + return dep + stack[v] = False + return False class ActionParser(object): @@ -299,7 +353,7 @@ def parse(self): for gvk, actions in operations.items(): model = self._package_parser.resolve_gvk(gvk) if not model: - print("GVK {} resolved to no known model".format(gvk)) + print("GVK {} resolved to no known model. No model to attach these actions to: {}".format(gvk, actions)) continue model.operations = sorted(actions, key=lambda a: a.action) counter[model] += len(actions) diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py index cae5a4e..2469447 100644 --- a/k8s/models/v1_6/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -23,6 +23,8 @@ class WatchEvent(Model): """ Event represents a single event to a watched resource. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") object = RequiredField(RawExtension) type = RequiredField(six.text_type) @@ -69,6 +71,8 @@ class APIVersions(Model): APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) versions = ListField(six.text_type) @@ -87,6 +91,8 @@ class DeleteOptions(Model): """ DeleteOptions may be provided when deleting an API object. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") gracePeriodSeconds = Field(int) orphanDependents = Field(bool) @@ -145,6 +151,8 @@ class Status(Model): """ Status is a return value for calls that don't return other objects. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") code = Field(int) details = Field(StatusDetails) @@ -191,6 +199,8 @@ class APIGroup(Model): APIGroup contains the name, the supported versions, and the preferred version of a group. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") name = RequiredField(six.text_type) preferredVersion = Field(GroupVersionForDiscovery) @@ -203,6 +213,8 @@ class APIGroupList(Model): APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") groups = ListField(APIGroup) @@ -224,6 +236,8 @@ class APIResourceList(Model): resources supported in a specific group and version, and if the resource is namespaced. """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py index a6a1d12..acc8b9d 100644 --- a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,17 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") metadata = Field(ObjectMeta) spec = Field(APIServiceSpec) @@ -79,6 +90,8 @@ class APIServiceList(Model): """ APIServiceList is a list of APIService objects. """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") items = ListField(APIService) metadata = Field(ListMeta) diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 385d1f8..97587c8 100644 --- a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -8,6 +8,7 @@ from k8s.base import Model from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_8.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta ############################################################################### @@ -18,15 +19,6 @@ ############################################################################### -class JSON(Model): - """ - JSON represents any valid JSON value. These types are supported: bool, int64, - float64, string, []interface{}, map[string]interface{} and nil. - """ - - Raw = RequiredField(six.text_type) - - class ExternalDocumentation(Model): """ ExternalDocumentation allows referencing an external resource for extended @@ -37,6 +29,14 @@ class ExternalDocumentation(Model): url = Field(six.text_type) +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + class CustomResourceDefinitionNames(Model): """ CustomResourceDefinitionNames indicates the names to serve this @@ -49,6 +49,19 @@ class CustomResourceDefinitionNames(Model): singular = Field(six.text_type) +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + validation = Field(CustomResourceValidation) + version = RequiredField(six.text_type) + + class CustomResourceDefinitionCondition(Model): """ CustomResourceDefinitionCondition contains details for the current condition of @@ -71,3 +84,36 @@ class CustomResourceDefinitionStatus(Model): acceptedNames = RequiredField(CustomResourceDefinitionNames) conditions = ListField(CustomResourceDefinitionCondition) + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = Field(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py index 5a92bf2..587dea1 100644 --- a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,17 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") metadata = Field(ObjectMeta) spec = Field(APIServiceSpec) @@ -79,6 +90,8 @@ class APIServiceList(Model): """ APIServiceList is a list of APIService objects. """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") items = ListField(APIService) metadata = Field(ListMeta) From ff860ca43c9ac964d72d353b79323a8c735ce382 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Thu, 10 Jan 2019 10:31:20 +0100 Subject: [PATCH 21/25] Generate 1.9 - 1.13 --- k8s/models/v1_10/__init__.py | 1 + k8s/models/v1_10/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 70 + .../api/admissionregistration/v1beta1.py | 128 + k8s/models/v1_10/api/apps/__init__.py | 1 + k8s/models/v1_10/api/apps/v1.py | 427 +++ k8s/models/v1_10/api/apps/v1beta1.py | 321 +++ k8s/models/v1_10/api/apps/v1beta2.py | 465 ++++ .../v1_10/api/authentication/__init__.py | 1 + k8s/models/v1_10/api/authentication/v1.py | 65 + .../v1_10/api/authentication/v1beta1.py | 65 + .../v1_10/api/authorization/__init__.py | 1 + k8s/models/v1_10/api/authorization/v1.py | 199 ++ k8s/models/v1_10/api/authorization/v1beta1.py | 199 ++ k8s/models/v1_10/api/autoscaling/__init__.py | 1 + k8s/models/v1_10/api/autoscaling/v1.py | 115 + k8s/models/v1_10/api/autoscaling/v2beta1.py | 228 ++ k8s/models/v1_10/api/batch/__init__.py | 1 + k8s/models/v1_10/api/batch/v1.py | 95 + k8s/models/v1_10/api/batch/v1beta1.py | 90 + k8s/models/v1_10/api/batch/v2alpha1.py | 90 + k8s/models/v1_10/api/certificates/__init__.py | 1 + k8s/models/v1_10/api/certificates/v1beta1.py | 87 + k8s/models/v1_10/api/core/__init__.py | 1 + k8s/models/v1_10/api/core/v1.py | 2252 ++++++++++++++++ k8s/models/v1_10/api/events/__init__.py | 1 + k8s/models/v1_10/api/events/v1beta1.py | 79 + k8s/models/v1_10/api/extensions/__init__.py | 1 + k8s/models/v1_10/api/extensions/v1beta1.py | 683 +++++ k8s/models/v1_10/api/networking/__init__.py | 1 + k8s/models/v1_10/api/networking/v1.py | 115 + k8s/models/v1_10/api/policy/__init__.py | 1 + k8s/models/v1_10/api/policy/v1beta1.py | 227 ++ k8s/models/v1_10/api/rbac/__init__.py | 1 + k8s/models/v1_10/api/rbac/v1.py | 201 ++ k8s/models/v1_10/api/rbac/v1alpha1.py | 200 ++ k8s/models/v1_10/api/rbac/v1beta1.py | 201 ++ k8s/models/v1_10/api/scheduling/__init__.py | 1 + k8s/models/v1_10/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_10/api/settings/__init__.py | 1 + k8s/models/v1_10/api/settings/v1alpha1.py | 65 + k8s/models/v1_10/api/storage/__init__.py | 1 + k8s/models/v1_10/api/storage/v1.py | 59 + k8s/models/v1_10/api/storage/v1alpha1.py | 95 + k8s/models/v1_10/api/storage/v1beta1.py | 136 + .../v1_10/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 142 + k8s/models/v1_10/apimachinery/__init__.py | 1 + .../v1_10/apimachinery/apis/__init__.py | 1 + .../v1_10/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_10/apimachinery/apis/meta/v1.py | 268 ++ k8s/models/v1_10/apimachinery/runtime.py | 66 + k8s/models/v1_10/apimachinery/version.py | 34 + k8s/models/v1_10/kube_aggregator/__init__.py | 1 + .../v1_10/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1.py | 98 + .../apis/apiregistration/v1beta1.py | 98 + k8s/models/v1_11/__init__.py | 1 + k8s/models/v1_11/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 70 + .../api/admissionregistration/v1beta1.py | 128 + k8s/models/v1_11/api/apps/__init__.py | 1 + k8s/models/v1_11/api/apps/v1.py | 427 +++ k8s/models/v1_11/api/apps/v1beta1.py | 321 +++ k8s/models/v1_11/api/apps/v1beta2.py | 465 ++++ .../v1_11/api/authentication/__init__.py | 1 + k8s/models/v1_11/api/authentication/v1.py | 65 + .../v1_11/api/authentication/v1beta1.py | 65 + .../v1_11/api/authorization/__init__.py | 1 + k8s/models/v1_11/api/authorization/v1.py | 199 ++ k8s/models/v1_11/api/authorization/v1beta1.py | 199 ++ k8s/models/v1_11/api/autoscaling/__init__.py | 1 + k8s/models/v1_11/api/autoscaling/v1.py | 115 + k8s/models/v1_11/api/autoscaling/v2beta1.py | 228 ++ k8s/models/v1_11/api/batch/__init__.py | 1 + k8s/models/v1_11/api/batch/v1.py | 95 + k8s/models/v1_11/api/batch/v1beta1.py | 90 + k8s/models/v1_11/api/batch/v2alpha1.py | 90 + k8s/models/v1_11/api/certificates/__init__.py | 1 + k8s/models/v1_11/api/certificates/v1beta1.py | 87 + k8s/models/v1_11/api/core/__init__.py | 1 + k8s/models/v1_11/api/core/v1.py | 2374 ++++++++++++++++ k8s/models/v1_11/api/events/__init__.py | 1 + k8s/models/v1_11/api/events/v1beta1.py | 79 + k8s/models/v1_11/api/extensions/__init__.py | 1 + k8s/models/v1_11/api/extensions/v1beta1.py | 696 +++++ k8s/models/v1_11/api/networking/__init__.py | 1 + k8s/models/v1_11/api/networking/v1.py | 115 + k8s/models/v1_11/api/policy/__init__.py | 1 + k8s/models/v1_11/api/policy/v1beta1.py | 230 ++ k8s/models/v1_11/api/rbac/__init__.py | 1 + k8s/models/v1_11/api/rbac/v1.py | 201 ++ k8s/models/v1_11/api/rbac/v1alpha1.py | 200 ++ k8s/models/v1_11/api/rbac/v1beta1.py | 201 ++ k8s/models/v1_11/api/scheduling/__init__.py | 1 + k8s/models/v1_11/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_11/api/scheduling/v1beta1.py | 52 + k8s/models/v1_11/api/settings/__init__.py | 1 + k8s/models/v1_11/api/settings/v1alpha1.py | 65 + k8s/models/v1_11/api/storage/__init__.py | 1 + k8s/models/v1_11/api/storage/v1.py | 61 + k8s/models/v1_11/api/storage/v1alpha1.py | 95 + k8s/models/v1_11/api/storage/v1beta1.py | 138 + .../v1_11/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 168 ++ k8s/models/v1_11/apimachinery/__init__.py | 1 + .../v1_11/apimachinery/apis/__init__.py | 1 + .../v1_11/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_11/apimachinery/apis/meta/v1.py | 268 ++ k8s/models/v1_11/apimachinery/runtime.py | 66 + k8s/models/v1_11/apimachinery/version.py | 34 + k8s/models/v1_11/kube_aggregator/__init__.py | 1 + .../v1_11/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1.py | 98 + .../apis/apiregistration/v1beta1.py | 98 + k8s/models/v1_12/__init__.py | 1 + k8s/models/v1_12/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 70 + .../api/admissionregistration/v1beta1.py | 129 + k8s/models/v1_12/api/apps/__init__.py | 1 + k8s/models/v1_12/api/apps/v1.py | 427 +++ k8s/models/v1_12/api/apps/v1beta1.py | 321 +++ k8s/models/v1_12/api/apps/v1beta2.py | 465 ++++ .../v1_12/api/authentication/__init__.py | 1 + k8s/models/v1_12/api/authentication/v1.py | 65 + .../v1_12/api/authentication/v1beta1.py | 65 + .../v1_12/api/authorization/__init__.py | 1 + k8s/models/v1_12/api/authorization/v1.py | 199 ++ k8s/models/v1_12/api/authorization/v1beta1.py | 199 ++ k8s/models/v1_12/api/autoscaling/__init__.py | 1 + k8s/models/v1_12/api/autoscaling/v1.py | 115 + k8s/models/v1_12/api/autoscaling/v2beta1.py | 234 ++ k8s/models/v1_12/api/autoscaling/v2beta2.py | 252 ++ k8s/models/v1_12/api/batch/__init__.py | 1 + k8s/models/v1_12/api/batch/v1.py | 96 + k8s/models/v1_12/api/batch/v1beta1.py | 90 + k8s/models/v1_12/api/batch/v2alpha1.py | 90 + k8s/models/v1_12/api/certificates/__init__.py | 1 + k8s/models/v1_12/api/certificates/v1beta1.py | 87 + k8s/models/v1_12/api/coordination/__init__.py | 1 + k8s/models/v1_12/api/coordination/v1beta1.py | 65 + k8s/models/v1_12/api/core/__init__.py | 1 + k8s/models/v1_12/api/core/v1.py | 2388 ++++++++++++++++ k8s/models/v1_12/api/events/__init__.py | 1 + k8s/models/v1_12/api/events/v1beta1.py | 79 + k8s/models/v1_12/api/extensions/__init__.py | 1 + k8s/models/v1_12/api/extensions/v1beta1.py | 697 +++++ k8s/models/v1_12/api/networking/__init__.py | 1 + k8s/models/v1_12/api/networking/v1.py | 115 + k8s/models/v1_12/api/policy/__init__.py | 1 + k8s/models/v1_12/api/policy/v1beta1.py | 231 ++ k8s/models/v1_12/api/rbac/__init__.py | 1 + k8s/models/v1_12/api/rbac/v1.py | 201 ++ k8s/models/v1_12/api/rbac/v1alpha1.py | 200 ++ k8s/models/v1_12/api/rbac/v1beta1.py | 201 ++ k8s/models/v1_12/api/scheduling/__init__.py | 1 + k8s/models/v1_12/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_12/api/scheduling/v1beta1.py | 52 + k8s/models/v1_12/api/settings/__init__.py | 1 + k8s/models/v1_12/api/settings/v1alpha1.py | 65 + k8s/models/v1_12/api/storage/__init__.py | 1 + k8s/models/v1_12/api/storage/v1.py | 61 + k8s/models/v1_12/api/storage/v1alpha1.py | 95 + k8s/models/v1_12/api/storage/v1beta1.py | 138 + .../v1_12/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 168 ++ k8s/models/v1_12/apimachinery/__init__.py | 1 + .../v1_12/apimachinery/apis/__init__.py | 1 + .../v1_12/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_12/apimachinery/apis/meta/v1.py | 269 ++ k8s/models/v1_12/apimachinery/runtime.py | 66 + k8s/models/v1_12/apimachinery/version.py | 34 + k8s/models/v1_12/kube_aggregator/__init__.py | 1 + .../v1_12/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1.py | 98 + .../apis/apiregistration/v1beta1.py | 98 + k8s/models/v1_13/__init__.py | 1 + k8s/models/v1_13/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 70 + .../api/admissionregistration/v1beta1.py | 129 + k8s/models/v1_13/api/apps/__init__.py | 1 + k8s/models/v1_13/api/apps/v1.py | 427 +++ k8s/models/v1_13/api/apps/v1beta1.py | 321 +++ k8s/models/v1_13/api/apps/v1beta2.py | 465 ++++ .../v1_13/api/auditregistration/__init__.py | 1 + .../v1_13/api/auditregistration/v1alpha1.py | 106 + .../v1_13/api/authentication/__init__.py | 1 + k8s/models/v1_13/api/authentication/v1.py | 67 + .../v1_13/api/authentication/v1beta1.py | 67 + .../v1_13/api/authorization/__init__.py | 1 + k8s/models/v1_13/api/authorization/v1.py | 199 ++ k8s/models/v1_13/api/authorization/v1beta1.py | 199 ++ k8s/models/v1_13/api/autoscaling/__init__.py | 1 + k8s/models/v1_13/api/autoscaling/v1.py | 115 + k8s/models/v1_13/api/autoscaling/v2beta1.py | 234 ++ k8s/models/v1_13/api/autoscaling/v2beta2.py | 252 ++ k8s/models/v1_13/api/batch/__init__.py | 1 + k8s/models/v1_13/api/batch/v1.py | 96 + k8s/models/v1_13/api/batch/v1beta1.py | 90 + k8s/models/v1_13/api/batch/v2alpha1.py | 90 + k8s/models/v1_13/api/certificates/__init__.py | 1 + k8s/models/v1_13/api/certificates/v1beta1.py | 87 + k8s/models/v1_13/api/coordination/__init__.py | 1 + k8s/models/v1_13/api/coordination/v1beta1.py | 65 + k8s/models/v1_13/api/core/__init__.py | 1 + k8s/models/v1_13/api/core/v1.py | 2401 +++++++++++++++++ k8s/models/v1_13/api/events/__init__.py | 1 + k8s/models/v1_13/api/events/v1beta1.py | 79 + k8s/models/v1_13/api/extensions/__init__.py | 1 + k8s/models/v1_13/api/extensions/v1beta1.py | 709 +++++ k8s/models/v1_13/api/networking/__init__.py | 1 + k8s/models/v1_13/api/networking/v1.py | 115 + k8s/models/v1_13/api/policy/__init__.py | 1 + k8s/models/v1_13/api/policy/v1beta1.py | 242 ++ k8s/models/v1_13/api/rbac/__init__.py | 1 + k8s/models/v1_13/api/rbac/v1.py | 201 ++ k8s/models/v1_13/api/rbac/v1alpha1.py | 200 ++ k8s/models/v1_13/api/rbac/v1beta1.py | 201 ++ k8s/models/v1_13/api/scheduling/__init__.py | 1 + k8s/models/v1_13/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_13/api/scheduling/v1beta1.py | 52 + k8s/models/v1_13/api/settings/__init__.py | 1 + k8s/models/v1_13/api/settings/v1alpha1.py | 65 + k8s/models/v1_13/api/storage/__init__.py | 1 + k8s/models/v1_13/api/storage/v1.py | 138 + k8s/models/v1_13/api/storage/v1alpha1.py | 95 + k8s/models/v1_13/api/storage/v1beta1.py | 138 + .../v1_13/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 203 ++ k8s/models/v1_13/apimachinery/__init__.py | 1 + .../v1_13/apimachinery/apis/__init__.py | 1 + .../v1_13/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_13/apimachinery/apis/meta/v1.py | 269 ++ k8s/models/v1_13/apimachinery/runtime.py | 66 + k8s/models/v1_13/apimachinery/version.py | 34 + k8s/models/v1_13/kube_aggregator/__init__.py | 1 + .../v1_13/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1.py | 98 + .../apis/apiregistration/v1beta1.py | 98 + k8s/models/v1_9/__init__.py | 1 + k8s/models/v1_9/api/__init__.py | 1 + .../api/admissionregistration/__init__.py | 1 + .../api/admissionregistration/v1alpha1.py | 70 + .../v1_9/api/admissionregistration/v1beta1.py | 128 + k8s/models/v1_9/api/apps/__init__.py | 1 + k8s/models/v1_9/api/apps/v1.py | 427 +++ k8s/models/v1_9/api/apps/v1beta1.py | 321 +++ k8s/models/v1_9/api/apps/v1beta2.py | 465 ++++ .../v1_9/api/authentication/__init__.py | 1 + k8s/models/v1_9/api/authentication/v1.py | 65 + k8s/models/v1_9/api/authentication/v1beta1.py | 65 + k8s/models/v1_9/api/authorization/__init__.py | 1 + k8s/models/v1_9/api/authorization/v1.py | 199 ++ k8s/models/v1_9/api/authorization/v1beta1.py | 199 ++ k8s/models/v1_9/api/autoscaling/__init__.py | 1 + k8s/models/v1_9/api/autoscaling/v1.py | 115 + k8s/models/v1_9/api/autoscaling/v2beta1.py | 200 ++ k8s/models/v1_9/api/batch/__init__.py | 1 + k8s/models/v1_9/api/batch/v1.py | 95 + k8s/models/v1_9/api/batch/v1beta1.py | 90 + k8s/models/v1_9/api/batch/v2alpha1.py | 90 + k8s/models/v1_9/api/certificates/__init__.py | 1 + k8s/models/v1_9/api/certificates/v1beta1.py | 87 + k8s/models/v1_9/api/core/__init__.py | 1 + k8s/models/v1_9/api/core/v1.py | 2218 +++++++++++++++ k8s/models/v1_9/api/events/__init__.py | 1 + k8s/models/v1_9/api/events/v1beta1.py | 79 + k8s/models/v1_9/api/extensions/__init__.py | 1 + k8s/models/v1_9/api/extensions/v1beta1.py | 683 +++++ k8s/models/v1_9/api/networking/__init__.py | 1 + k8s/models/v1_9/api/networking/v1.py | 115 + k8s/models/v1_9/api/policy/__init__.py | 1 + k8s/models/v1_9/api/policy/v1beta1.py | 93 + k8s/models/v1_9/api/rbac/__init__.py | 1 + k8s/models/v1_9/api/rbac/v1.py | 201 ++ k8s/models/v1_9/api/rbac/v1alpha1.py | 200 ++ k8s/models/v1_9/api/rbac/v1beta1.py | 201 ++ k8s/models/v1_9/api/scheduling/__init__.py | 1 + k8s/models/v1_9/api/scheduling/v1alpha1.py | 52 + k8s/models/v1_9/api/settings/__init__.py | 1 + k8s/models/v1_9/api/settings/v1alpha1.py | 65 + k8s/models/v1_9/api/storage/__init__.py | 1 + k8s/models/v1_9/api/storage/v1.py | 59 + k8s/models/v1_9/api/storage/v1alpha1.py | 95 + k8s/models/v1_9/api/storage/v1beta1.py | 59 + .../v1_9/apiextensions_apiserver/__init__.py | 1 + .../apiextensions_apiserver/apis/__init__.py | 1 + .../apis/apiextensions/__init__.py | 1 + .../apis/apiextensions/v1beta1.py | 119 + k8s/models/v1_9/apimachinery/__init__.py | 1 + k8s/models/v1_9/apimachinery/apis/__init__.py | 1 + .../v1_9/apimachinery/apis/meta/__init__.py | 1 + k8s/models/v1_9/apimachinery/apis/meta/v1.py | 268 ++ k8s/models/v1_9/apimachinery/runtime.py | 66 + k8s/models/v1_9/apimachinery/version.py | 34 + k8s/models/v1_9/kube_aggregator/__init__.py | 1 + .../v1_9/kube_aggregator/apis/__init__.py | 1 + .../apis/apiregistration/__init__.py | 1 + .../apis/apiregistration/v1beta1.py | 98 + 315 files changed, 39921 insertions(+) create mode 100644 k8s/models/v1_10/__init__.py create mode 100644 k8s/models/v1_10/api/__init__.py create mode 100644 k8s/models/v1_10/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_10/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_10/api/admissionregistration/v1beta1.py create mode 100644 k8s/models/v1_10/api/apps/__init__.py create mode 100644 k8s/models/v1_10/api/apps/v1.py create mode 100644 k8s/models/v1_10/api/apps/v1beta1.py create mode 100644 k8s/models/v1_10/api/apps/v1beta2.py create mode 100644 k8s/models/v1_10/api/authentication/__init__.py create mode 100644 k8s/models/v1_10/api/authentication/v1.py create mode 100644 k8s/models/v1_10/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_10/api/authorization/__init__.py create mode 100644 k8s/models/v1_10/api/authorization/v1.py create mode 100644 k8s/models/v1_10/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_10/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_10/api/autoscaling/v1.py create mode 100644 k8s/models/v1_10/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_10/api/batch/__init__.py create mode 100644 k8s/models/v1_10/api/batch/v1.py create mode 100644 k8s/models/v1_10/api/batch/v1beta1.py create mode 100644 k8s/models/v1_10/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_10/api/certificates/__init__.py create mode 100644 k8s/models/v1_10/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_10/api/core/__init__.py create mode 100644 k8s/models/v1_10/api/core/v1.py create mode 100644 k8s/models/v1_10/api/events/__init__.py create mode 100644 k8s/models/v1_10/api/events/v1beta1.py create mode 100644 k8s/models/v1_10/api/extensions/__init__.py create mode 100644 k8s/models/v1_10/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_10/api/networking/__init__.py create mode 100644 k8s/models/v1_10/api/networking/v1.py create mode 100644 k8s/models/v1_10/api/policy/__init__.py create mode 100644 k8s/models/v1_10/api/policy/v1beta1.py create mode 100644 k8s/models/v1_10/api/rbac/__init__.py create mode 100644 k8s/models/v1_10/api/rbac/v1.py create mode 100644 k8s/models/v1_10/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_10/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_10/api/scheduling/__init__.py create mode 100644 k8s/models/v1_10/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_10/api/settings/__init__.py create mode 100644 k8s/models/v1_10/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_10/api/storage/__init__.py create mode 100644 k8s/models/v1_10/api/storage/v1.py create mode 100644 k8s/models/v1_10/api/storage/v1alpha1.py create mode 100644 k8s/models/v1_10/api/storage/v1beta1.py create mode 100644 k8s/models/v1_10/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_10/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_10/apimachinery/__init__.py create mode 100644 k8s/models/v1_10/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_10/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_10/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_10/apimachinery/runtime.py create mode 100644 k8s/models/v1_10/apimachinery/version.py create mode 100644 k8s/models/v1_10/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_10/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_10/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py create mode 100644 k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py create mode 100644 k8s/models/v1_11/__init__.py create mode 100644 k8s/models/v1_11/api/__init__.py create mode 100644 k8s/models/v1_11/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_11/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_11/api/admissionregistration/v1beta1.py create mode 100644 k8s/models/v1_11/api/apps/__init__.py create mode 100644 k8s/models/v1_11/api/apps/v1.py create mode 100644 k8s/models/v1_11/api/apps/v1beta1.py create mode 100644 k8s/models/v1_11/api/apps/v1beta2.py create mode 100644 k8s/models/v1_11/api/authentication/__init__.py create mode 100644 k8s/models/v1_11/api/authentication/v1.py create mode 100644 k8s/models/v1_11/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_11/api/authorization/__init__.py create mode 100644 k8s/models/v1_11/api/authorization/v1.py create mode 100644 k8s/models/v1_11/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_11/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_11/api/autoscaling/v1.py create mode 100644 k8s/models/v1_11/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_11/api/batch/__init__.py create mode 100644 k8s/models/v1_11/api/batch/v1.py create mode 100644 k8s/models/v1_11/api/batch/v1beta1.py create mode 100644 k8s/models/v1_11/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_11/api/certificates/__init__.py create mode 100644 k8s/models/v1_11/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_11/api/core/__init__.py create mode 100644 k8s/models/v1_11/api/core/v1.py create mode 100644 k8s/models/v1_11/api/events/__init__.py create mode 100644 k8s/models/v1_11/api/events/v1beta1.py create mode 100644 k8s/models/v1_11/api/extensions/__init__.py create mode 100644 k8s/models/v1_11/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_11/api/networking/__init__.py create mode 100644 k8s/models/v1_11/api/networking/v1.py create mode 100644 k8s/models/v1_11/api/policy/__init__.py create mode 100644 k8s/models/v1_11/api/policy/v1beta1.py create mode 100644 k8s/models/v1_11/api/rbac/__init__.py create mode 100644 k8s/models/v1_11/api/rbac/v1.py create mode 100644 k8s/models/v1_11/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_11/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_11/api/scheduling/__init__.py create mode 100644 k8s/models/v1_11/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_11/api/scheduling/v1beta1.py create mode 100644 k8s/models/v1_11/api/settings/__init__.py create mode 100644 k8s/models/v1_11/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_11/api/storage/__init__.py create mode 100644 k8s/models/v1_11/api/storage/v1.py create mode 100644 k8s/models/v1_11/api/storage/v1alpha1.py create mode 100644 k8s/models/v1_11/api/storage/v1beta1.py create mode 100644 k8s/models/v1_11/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_11/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_11/apimachinery/__init__.py create mode 100644 k8s/models/v1_11/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_11/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_11/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_11/apimachinery/runtime.py create mode 100644 k8s/models/v1_11/apimachinery/version.py create mode 100644 k8s/models/v1_11/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_11/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_11/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py create mode 100644 k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py create mode 100644 k8s/models/v1_12/__init__.py create mode 100644 k8s/models/v1_12/api/__init__.py create mode 100644 k8s/models/v1_12/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_12/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_12/api/admissionregistration/v1beta1.py create mode 100644 k8s/models/v1_12/api/apps/__init__.py create mode 100644 k8s/models/v1_12/api/apps/v1.py create mode 100644 k8s/models/v1_12/api/apps/v1beta1.py create mode 100644 k8s/models/v1_12/api/apps/v1beta2.py create mode 100644 k8s/models/v1_12/api/authentication/__init__.py create mode 100644 k8s/models/v1_12/api/authentication/v1.py create mode 100644 k8s/models/v1_12/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_12/api/authorization/__init__.py create mode 100644 k8s/models/v1_12/api/authorization/v1.py create mode 100644 k8s/models/v1_12/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_12/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_12/api/autoscaling/v1.py create mode 100644 k8s/models/v1_12/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_12/api/autoscaling/v2beta2.py create mode 100644 k8s/models/v1_12/api/batch/__init__.py create mode 100644 k8s/models/v1_12/api/batch/v1.py create mode 100644 k8s/models/v1_12/api/batch/v1beta1.py create mode 100644 k8s/models/v1_12/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_12/api/certificates/__init__.py create mode 100644 k8s/models/v1_12/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_12/api/coordination/__init__.py create mode 100644 k8s/models/v1_12/api/coordination/v1beta1.py create mode 100644 k8s/models/v1_12/api/core/__init__.py create mode 100644 k8s/models/v1_12/api/core/v1.py create mode 100644 k8s/models/v1_12/api/events/__init__.py create mode 100644 k8s/models/v1_12/api/events/v1beta1.py create mode 100644 k8s/models/v1_12/api/extensions/__init__.py create mode 100644 k8s/models/v1_12/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_12/api/networking/__init__.py create mode 100644 k8s/models/v1_12/api/networking/v1.py create mode 100644 k8s/models/v1_12/api/policy/__init__.py create mode 100644 k8s/models/v1_12/api/policy/v1beta1.py create mode 100644 k8s/models/v1_12/api/rbac/__init__.py create mode 100644 k8s/models/v1_12/api/rbac/v1.py create mode 100644 k8s/models/v1_12/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_12/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_12/api/scheduling/__init__.py create mode 100644 k8s/models/v1_12/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_12/api/scheduling/v1beta1.py create mode 100644 k8s/models/v1_12/api/settings/__init__.py create mode 100644 k8s/models/v1_12/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_12/api/storage/__init__.py create mode 100644 k8s/models/v1_12/api/storage/v1.py create mode 100644 k8s/models/v1_12/api/storage/v1alpha1.py create mode 100644 k8s/models/v1_12/api/storage/v1beta1.py create mode 100644 k8s/models/v1_12/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_12/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_12/apimachinery/__init__.py create mode 100644 k8s/models/v1_12/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_12/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_12/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_12/apimachinery/runtime.py create mode 100644 k8s/models/v1_12/apimachinery/version.py create mode 100644 k8s/models/v1_12/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_12/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_12/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py create mode 100644 k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py create mode 100644 k8s/models/v1_13/__init__.py create mode 100644 k8s/models/v1_13/api/__init__.py create mode 100644 k8s/models/v1_13/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_13/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_13/api/admissionregistration/v1beta1.py create mode 100644 k8s/models/v1_13/api/apps/__init__.py create mode 100644 k8s/models/v1_13/api/apps/v1.py create mode 100644 k8s/models/v1_13/api/apps/v1beta1.py create mode 100644 k8s/models/v1_13/api/apps/v1beta2.py create mode 100644 k8s/models/v1_13/api/auditregistration/__init__.py create mode 100644 k8s/models/v1_13/api/auditregistration/v1alpha1.py create mode 100644 k8s/models/v1_13/api/authentication/__init__.py create mode 100644 k8s/models/v1_13/api/authentication/v1.py create mode 100644 k8s/models/v1_13/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_13/api/authorization/__init__.py create mode 100644 k8s/models/v1_13/api/authorization/v1.py create mode 100644 k8s/models/v1_13/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_13/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_13/api/autoscaling/v1.py create mode 100644 k8s/models/v1_13/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_13/api/autoscaling/v2beta2.py create mode 100644 k8s/models/v1_13/api/batch/__init__.py create mode 100644 k8s/models/v1_13/api/batch/v1.py create mode 100644 k8s/models/v1_13/api/batch/v1beta1.py create mode 100644 k8s/models/v1_13/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_13/api/certificates/__init__.py create mode 100644 k8s/models/v1_13/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_13/api/coordination/__init__.py create mode 100644 k8s/models/v1_13/api/coordination/v1beta1.py create mode 100644 k8s/models/v1_13/api/core/__init__.py create mode 100644 k8s/models/v1_13/api/core/v1.py create mode 100644 k8s/models/v1_13/api/events/__init__.py create mode 100644 k8s/models/v1_13/api/events/v1beta1.py create mode 100644 k8s/models/v1_13/api/extensions/__init__.py create mode 100644 k8s/models/v1_13/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_13/api/networking/__init__.py create mode 100644 k8s/models/v1_13/api/networking/v1.py create mode 100644 k8s/models/v1_13/api/policy/__init__.py create mode 100644 k8s/models/v1_13/api/policy/v1beta1.py create mode 100644 k8s/models/v1_13/api/rbac/__init__.py create mode 100644 k8s/models/v1_13/api/rbac/v1.py create mode 100644 k8s/models/v1_13/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_13/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_13/api/scheduling/__init__.py create mode 100644 k8s/models/v1_13/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_13/api/scheduling/v1beta1.py create mode 100644 k8s/models/v1_13/api/settings/__init__.py create mode 100644 k8s/models/v1_13/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_13/api/storage/__init__.py create mode 100644 k8s/models/v1_13/api/storage/v1.py create mode 100644 k8s/models/v1_13/api/storage/v1alpha1.py create mode 100644 k8s/models/v1_13/api/storage/v1beta1.py create mode 100644 k8s/models/v1_13/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_13/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_13/apimachinery/__init__.py create mode 100644 k8s/models/v1_13/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_13/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_13/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_13/apimachinery/runtime.py create mode 100644 k8s/models/v1_13/apimachinery/version.py create mode 100644 k8s/models/v1_13/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_13/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_13/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py create mode 100644 k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py create mode 100644 k8s/models/v1_9/__init__.py create mode 100644 k8s/models/v1_9/api/__init__.py create mode 100644 k8s/models/v1_9/api/admissionregistration/__init__.py create mode 100644 k8s/models/v1_9/api/admissionregistration/v1alpha1.py create mode 100644 k8s/models/v1_9/api/admissionregistration/v1beta1.py create mode 100644 k8s/models/v1_9/api/apps/__init__.py create mode 100644 k8s/models/v1_9/api/apps/v1.py create mode 100644 k8s/models/v1_9/api/apps/v1beta1.py create mode 100644 k8s/models/v1_9/api/apps/v1beta2.py create mode 100644 k8s/models/v1_9/api/authentication/__init__.py create mode 100644 k8s/models/v1_9/api/authentication/v1.py create mode 100644 k8s/models/v1_9/api/authentication/v1beta1.py create mode 100644 k8s/models/v1_9/api/authorization/__init__.py create mode 100644 k8s/models/v1_9/api/authorization/v1.py create mode 100644 k8s/models/v1_9/api/authorization/v1beta1.py create mode 100644 k8s/models/v1_9/api/autoscaling/__init__.py create mode 100644 k8s/models/v1_9/api/autoscaling/v1.py create mode 100644 k8s/models/v1_9/api/autoscaling/v2beta1.py create mode 100644 k8s/models/v1_9/api/batch/__init__.py create mode 100644 k8s/models/v1_9/api/batch/v1.py create mode 100644 k8s/models/v1_9/api/batch/v1beta1.py create mode 100644 k8s/models/v1_9/api/batch/v2alpha1.py create mode 100644 k8s/models/v1_9/api/certificates/__init__.py create mode 100644 k8s/models/v1_9/api/certificates/v1beta1.py create mode 100644 k8s/models/v1_9/api/core/__init__.py create mode 100644 k8s/models/v1_9/api/core/v1.py create mode 100644 k8s/models/v1_9/api/events/__init__.py create mode 100644 k8s/models/v1_9/api/events/v1beta1.py create mode 100644 k8s/models/v1_9/api/extensions/__init__.py create mode 100644 k8s/models/v1_9/api/extensions/v1beta1.py create mode 100644 k8s/models/v1_9/api/networking/__init__.py create mode 100644 k8s/models/v1_9/api/networking/v1.py create mode 100644 k8s/models/v1_9/api/policy/__init__.py create mode 100644 k8s/models/v1_9/api/policy/v1beta1.py create mode 100644 k8s/models/v1_9/api/rbac/__init__.py create mode 100644 k8s/models/v1_9/api/rbac/v1.py create mode 100644 k8s/models/v1_9/api/rbac/v1alpha1.py create mode 100644 k8s/models/v1_9/api/rbac/v1beta1.py create mode 100644 k8s/models/v1_9/api/scheduling/__init__.py create mode 100644 k8s/models/v1_9/api/scheduling/v1alpha1.py create mode 100644 k8s/models/v1_9/api/settings/__init__.py create mode 100644 k8s/models/v1_9/api/settings/v1alpha1.py create mode 100644 k8s/models/v1_9/api/storage/__init__.py create mode 100644 k8s/models/v1_9/api/storage/v1.py create mode 100644 k8s/models/v1_9/api/storage/v1alpha1.py create mode 100644 k8s/models/v1_9/api/storage/v1beta1.py create mode 100644 k8s/models/v1_9/apiextensions_apiserver/__init__.py create mode 100644 k8s/models/v1_9/apiextensions_apiserver/apis/__init__.py create mode 100644 k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/__init__.py create mode 100644 k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py create mode 100644 k8s/models/v1_9/apimachinery/__init__.py create mode 100644 k8s/models/v1_9/apimachinery/apis/__init__.py create mode 100644 k8s/models/v1_9/apimachinery/apis/meta/__init__.py create mode 100644 k8s/models/v1_9/apimachinery/apis/meta/v1.py create mode 100644 k8s/models/v1_9/apimachinery/runtime.py create mode 100644 k8s/models/v1_9/apimachinery/version.py create mode 100644 k8s/models/v1_9/kube_aggregator/__init__.py create mode 100644 k8s/models/v1_9/kube_aggregator/apis/__init__.py create mode 100644 k8s/models/v1_9/kube_aggregator/apis/apiregistration/__init__.py create mode 100644 k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py diff --git a/k8s/models/v1_10/__init__.py b/k8s/models/v1_10/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/__init__.py b/k8s/models/v1_10/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/admissionregistration/__init__.py b/k8s/models/v1_10/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/admissionregistration/v1alpha1.py b/k8s/models/v1_10/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..e055896 --- /dev/null +++ b/k8s/models/v1_10/api/admissionregistration/v1alpha1.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/admissionregistration/v1beta1.py b/k8s/models/v1_10/api/admissionregistration/v1beta1.py new file mode 100644 index 0000000..c9b1c5c --- /dev/null +++ b/k8s/models/v1_10/api/admissionregistration/v1beta1.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook + """ + + caBundle = RequiredField(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Webhook(Model): + """ + Webhook describes an admission webhook and the resources and operations it + applies to. + """ + + clientConfig = RequiredField(WebhookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + namespaceSelector = Field(LabelSelector) + rules = ListField(RuleWithOperations) + + +class ValidatingWebhookConfiguration(Model): + """ + ValidatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and object without changing it. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class ValidatingWebhookConfigurationList(Model): + """ + ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfigurationList") + + items = ListField(ValidatingWebhookConfiguration) + metadata = Field(ListMeta) + + +class MutatingWebhookConfiguration(Model): + """ + MutatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and may change the object. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class MutatingWebhookConfigurationList(Model): + """ + MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfigurationList") + + items = ListField(MutatingWebhookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/apps/__init__.py b/k8s/models/v1_10/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/apps/v1.py b/k8s/models/v1_10/api/apps/v1.py new file mode 100644 index 0000000..9ad9f88 --- /dev/null +++ b/k8s/models/v1_10/api/apps/v1.py @@ -0,0 +1,427 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_10.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1/statefulsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet ensures that a specified number of pod replicas are running at any + given time. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1/replicasets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1/deployments" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1/daemonsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1/controllerrevisions" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/apps/v1beta1.py b/k8s/models/v1_10/api/apps/v1beta1.py new file mode 100644 index 0000000..13e5ac4 --- /dev/null +++ b/k8s/models/v1_10/api/apps/v1beta1.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_10.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/apps/v1beta2.py b/k8s/models/v1_10/api/apps/v1beta2.py new file mode 100644 index 0000000..abe1693 --- /dev/null +++ b/k8s/models/v1_10/api/apps/v1beta2.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_10.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1/StatefulSet. See the release notes for more information. StatefulSet + represents a set of pods with consistent identities. Identities are defined as: + - Network: A single stable DNS and hostname. + - Storage: As many VolumeClaims + as requested. + The StatefulSet guarantees that a given network identity will + always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/authentication/__init__.py b/k8s/models/v1_10/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/authentication/v1.py b/k8s/models/v1_10/api/authentication/v1.py new file mode 100644 index 0000000..0e3efd4 --- /dev/null +++ b/k8s/models/v1_10/api/authentication/v1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_10/api/authentication/v1beta1.py b/k8s/models/v1_10/api/authentication/v1beta1.py new file mode 100644 index 0000000..231f332 --- /dev/null +++ b/k8s/models/v1_10/api/authentication/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_10/api/authorization/__init__.py b/k8s/models/v1_10/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/authorization/v1.py b/k8s/models/v1_10/api/authorization/v1.py new file mode 100644 index 0000000..7f49689 --- /dev/null +++ b/k8s/models/v1_10/api/authorization/v1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_10/api/authorization/v1beta1.py b/k8s/models/v1_10/api/authorization/v1beta1.py new file mode 100644 index 0000000..3709624 --- /dev/null +++ b/k8s/models/v1_10/api/authorization/v1beta1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_10/api/autoscaling/__init__.py b/k8s/models/v1_10/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/autoscaling/v1.py b/k8s/models/v1_10/api/autoscaling/v1.py new file mode 100644 index 0000000..8377528 --- /dev/null +++ b/k8s/models/v1_10/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/autoscaling/v2beta1.py b/k8s/models/v1_10/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..81439ae --- /dev/null +++ b/k8s/models/v1_10/api/autoscaling/v2beta1.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + currentAverageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). Exactly one 'target' type + should be set. + """ + + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + targetAverageValue = Field(six.text_type) + targetValue = Field(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/batch/__init__.py b/k8s/models/v1_10/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/batch/v1.py b/k8s/models/v1_10/api/batch/v1.py new file mode 100644 index 0000000..62fd5f6 --- /dev/null +++ b/k8s/models/v1_10/api/batch/v1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.api.core.v1 import PodTemplateSpec +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/batch/v1beta1.py b/k8s/models/v1_10/api/batch/v1beta1.py new file mode 100644 index 0000000..bdcf072 --- /dev/null +++ b/k8s/models/v1_10/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.api.batch.v1 import JobSpec +from k8s.models.v1_10.api.core.v1 import ObjectReference +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/batch/v2alpha1.py b/k8s/models/v1_10/api/batch/v2alpha1.py new file mode 100644 index 0000000..3441db0 --- /dev/null +++ b/k8s/models/v1_10/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.api.batch.v1 import JobSpec +from k8s.models.v1_10.api.core.v1 import ObjectReference +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/certificates/__init__.py b/k8s/models/v1_10/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/certificates/v1beta1.py b/k8s/models/v1_10/api/certificates/v1beta1.py new file mode 100644 index 0000000..866be0c --- /dev/null +++ b/k8s/models/v1_10/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/core/__init__.py b/k8s/models/v1_10/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/core/v1.py b/k8s/models/v1_10/api/core/v1.py new file mode 100644 index 0000000..4e5e9d4 --- /dev/null +++ b/k8s/models/v1_10/api/core/v1.py @@ -0,0 +1,2252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class VolumeDevice(Model): + """ + volumeDevice describes a mapping of a raw block device within a container. + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDPersistentVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class ISCSIPersistentVolumeSource(Model): + """ + ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be + mounted as read/write once. ISCSI volumes support ownership management and + SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + targetPortal = RequiredField(six.text_type) + + +class FlexPersistentVolumeSource(Model): + """ + FlexPersistentVolumeSource represents a generic persistent volume resource that + is provisioned/attached using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(SecretReference) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class CSIPersistentVolumeSource(Model): + """ + Represents storage that is managed by an external CSI volume driver (Beta + feature) + """ + + controllerPublishSecretRef = Field(SecretReference) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + nodePublishSecretRef = Field(SecretReference) + nodeStageSecretRef = Field(SecretReference) + readOnly = Field(bool) + volumeAttributes = Field(dict) + volumeHandle = RequiredField(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeMode = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopes = ListField(six.text_type) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodDNSConfigOption(Model): + """ + PodDNSConfigOption defines DNS resolver options of a pod. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class PodDNSConfig(Model): + """ + PodDNSConfig defines the DNS parameters of a pod in addition to those generated + from DNSPolicy. + """ + + nameservers = ListField(six.text_type) + options = ListField(PodDNSConfigOption) + searches = ListField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key matches that of any node on + which a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = RequiredField(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeConfigSource") + + configMapRef = Field(ObjectReference) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class VolumeNodeAffinity(Model): + """ + VolumeNodeAffinity defines constraints that limit what nodes this volume can be + accessed from. + """ + + required = Field(NodeSelector) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity + """ + + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = Field(int) + lastObservedTime = Field(datetime.datetime) + state = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + count = Field(int) + eventTime = Field(datetime.datetime) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + related = Field(ObjectReference) + reportingComponent = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + nominatedNodeName = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + binaryData = Field(dict) + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeDevices = ListField(VolumeDevice) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsConfig = Field(PodDNSConfig) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + shareProcessNamespace = Field(bool) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + csi = Field(CSIPersistentVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexPersistentVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIPersistentVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + nodeAffinity = Field(VolumeNodeAffinity) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDPersistentVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + volumeMode = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/events/__init__.py b/k8s/models/v1_10/api/events/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/events/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/events/v1beta1.py b/k8s/models/v1_10/api/events/v1beta1.py new file mode 100644 index 0000000..34a78d3 --- /dev/null +++ b/k8s/models/v1_10/api/events/v1beta1.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.api.core.v1 import EventSource, ObjectReference +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = RequiredField(int) + lastObservedTime = RequiredField(datetime.datetime) + state = RequiredField(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. It generally denotes + some state change in the system. + """ + class Meta: + create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + get_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + list_all_url = "/apis/events.k8s.io/v1beta1/events" + list_ns_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + update_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" + watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + deprecatedCount = Field(int) + deprecatedFirstTimestamp = Field(datetime.datetime) + deprecatedLastTimestamp = Field(datetime.datetime) + deprecatedSource = Field(EventSource) + eventTime = RequiredField(datetime.datetime) + metadata = Field(ObjectMeta) + note = Field(six.text_type) + reason = Field(six.text_type) + regarding = Field(ObjectReference) + related = Field(ObjectReference) + reportingController = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of Event objects. + """ + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/extensions/__init__.py b/k8s/models/v1_10/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/extensions/v1beta1.py b/k8s/models/v1_10/api/extensions/v1beta1.py new file mode 100644 index 0000000..f3852d5 --- /dev/null +++ b/k8s/models/v1_10/api/extensions/v1beta1.py @@ -0,0 +1,683 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by + networking/v1/NetworkPolicyPort. + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + DEPRECATED 1.9 - This group version of IPBlock is deprecated by + networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. + '192.168.1.1/24') that is allowed to the pods matched by a NetworkPolicySpec's + podSelector. The except entry describes CIDRs that should not be included + within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by + networking/v1/NetworkPolicyPeer. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated + by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule + matches traffic if and only if the traffic matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by + networking/v1/NetworkPolicyEgressRule. NetworkPolicyEgressRule describes a + particular set of traffic that is allowed out of pods matched by a + NetworkPolicySpec's podSelector. The traffic must match both ports and to. This + type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by + networking/v1/NetworkPolicySpec. + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by + networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is + allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by + networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy + objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + defines the host volume conditions that will be enabled by a policy for pods to + use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/networking/__init__.py b/k8s/models/v1_10/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/networking/v1.py b/k8s/models/v1_10/api/networking/v1.py new file mode 100644 index 0000000..07dc2dc --- /dev/null +++ b/k8s/models/v1_10/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its + fields must be specified. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/policy/__init__.py b/k8s/models/v1_10/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/policy/v1beta1.py b/k8s/models/v1_10/api/policy/v1beta1.py new file mode 100644 index 0000000..3e96035 --- /dev/null +++ b/k8s/models/v1_10/api/policy/v1beta1.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.api.core.v1 import SELinuxOptions +from k8s.models.v1_10.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + +class AllowedHostPath(Model): + """ + defines the host volume conditions that will be enabled by a policy for pods to + use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/policy/v1beta1/podsecuritypolicies" + delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/policy/v1beta1/podsecuritypolicies" + update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/rbac/__init__.py b/k8s/models/v1_10/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/rbac/v1.py b/k8s/models/v1_10/api/rbac/v1.py new file mode 100644 index 0000000..f149e91 --- /dev/null +++ b/k8s/models/v1_10/api/rbac/v1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/rbac/v1alpha1.py b/k8s/models/v1_10/api/rbac/v1alpha1.py new file mode 100644 index 0000000..439426f --- /dev/null +++ b/k8s/models/v1_10/api/rbac/v1alpha1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/rbac/v1beta1.py b/k8s/models/v1_10/api/rbac/v1beta1.py new file mode 100644 index 0000000..f9a8586 --- /dev/null +++ b/k8s/models/v1_10/api/rbac/v1beta1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/scheduling/__init__.py b/k8s/models/v1_10/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/scheduling/v1alpha1.py b/k8s/models/v1_10/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..518984f --- /dev/null +++ b/k8s/models/v1_10/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/settings/__init__.py b/k8s/models/v1_10/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/settings/v1alpha1.py b/k8s/models/v1_10/api/settings/v1alpha1.py new file mode 100644 index 0000000..2c6e322 --- /dev/null +++ b/k8s/models/v1_10/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_10.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_10.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/storage/__init__.py b/k8s/models/v1_10/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/api/storage/v1.py b/k8s/models/v1_10/api/storage/v1.py new file mode 100644 index 0000000..7b78a8e --- /dev/null +++ b/k8s/models/v1_10/api/storage/v1.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/storage/v1alpha1.py b/k8s/models/v1_10/api/storage/v1alpha1.py new file mode 100644 index 0000000..aba5149 --- /dev/null +++ b/k8s/models/v1_10/api/storage/v1alpha1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/api/storage/v1beta1.py b/k8s/models/v1_10/api/storage/v1beta1.py new file mode 100644 index 0000000..4763319 --- /dev/null +++ b/k8s/models/v1_10/api/storage/v1beta1.py @@ -0,0 +1,136 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/apiextensions_apiserver/__init__.py b/k8s/models/v1_10/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_10/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..50e3e88 --- /dev/null +++ b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,142 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + +class CustomResourceSubresourceScale(Model): + """ + CustomResourceSubresourceScale defines how to serve the scale subresource for + CustomResources. + """ + + labelSelectorPath = Field(six.text_type) + specReplicasPath = RequiredField(six.text_type) + statusReplicasPath = RequiredField(six.text_type) + + +class CustomResourceSubresources(Model): + """ + CustomResourceSubresources defines the status and scale subresources for + CustomResources. + """ + + scale = Field(CustomResourceSubresourceScale) + status = Field(dict) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + categories = ListField(six.text_type) + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + subresources = Field(CustomResourceSubresources) + validation = Field(CustomResourceValidation) + version = RequiredField(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = Field(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/apimachinery/__init__.py b/k8s/models/v1_10/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apimachinery/apis/__init__.py b/k8s/models/v1_10/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apimachinery/apis/meta/__init__.py b/k8s/models/v1_10/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/apimachinery/apis/meta/v1.py b/k8s/models/v1_10/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..1c5a5a1 --- /dev/null +++ b/k8s/models/v1_10/apimachinery/apis/meta/v1.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_10.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_10/apimachinery/runtime.py b/k8s/models/v1_10/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_10/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_10/apimachinery/version.py b/k8s/models/v1_10/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_10/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_10/kube_aggregator/__init__.py b/k8s/models/v1_10/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/kube_aggregator/apis/__init__.py b/k8s/models/v1_10/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py new file mode 100644 index 0000000..054fa7b --- /dev/null +++ b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = RequiredField(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..7cbe5e6 --- /dev/null +++ b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_10.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = RequiredField(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/__init__.py b/k8s/models/v1_11/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/__init__.py b/k8s/models/v1_11/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/admissionregistration/__init__.py b/k8s/models/v1_11/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/admissionregistration/v1alpha1.py b/k8s/models/v1_11/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..e18c37f --- /dev/null +++ b/k8s/models/v1_11/api/admissionregistration/v1alpha1.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/admissionregistration/v1beta1.py b/k8s/models/v1_11/api/admissionregistration/v1beta1.py new file mode 100644 index 0000000..846ae8f --- /dev/null +++ b/k8s/models/v1_11/api/admissionregistration/v1beta1.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook + """ + + caBundle = RequiredField(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Webhook(Model): + """ + Webhook describes an admission webhook and the resources and operations it + applies to. + """ + + clientConfig = RequiredField(WebhookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + namespaceSelector = Field(LabelSelector) + rules = ListField(RuleWithOperations) + + +class ValidatingWebhookConfiguration(Model): + """ + ValidatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and object without changing it. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class ValidatingWebhookConfigurationList(Model): + """ + ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfigurationList") + + items = ListField(ValidatingWebhookConfiguration) + metadata = Field(ListMeta) + + +class MutatingWebhookConfiguration(Model): + """ + MutatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and may change the object. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class MutatingWebhookConfigurationList(Model): + """ + MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfigurationList") + + items = ListField(MutatingWebhookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/apps/__init__.py b/k8s/models/v1_11/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/apps/v1.py b/k8s/models/v1_11/api/apps/v1.py new file mode 100644 index 0000000..3a0fdd1 --- /dev/null +++ b/k8s/models/v1_11/api/apps/v1.py @@ -0,0 +1,427 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_11.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1/statefulsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet ensures that a specified number of pod replicas are running at any + given time. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1/replicasets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1/deployments" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1/daemonsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1/controllerrevisions" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/apps/v1beta1.py b/k8s/models/v1_11/api/apps/v1beta1.py new file mode 100644 index 0000000..d4c2090 --- /dev/null +++ b/k8s/models/v1_11/api/apps/v1beta1.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_11.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/apps/v1beta2.py b/k8s/models/v1_11/api/apps/v1beta2.py new file mode 100644 index 0000000..1bc22d0 --- /dev/null +++ b/k8s/models/v1_11/api/apps/v1beta2.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_11.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1/StatefulSet. See the release notes for more information. StatefulSet + represents a set of pods with consistent identities. Identities are defined as: + - Network: A single stable DNS and hostname. + - Storage: As many VolumeClaims + as requested. + The StatefulSet guarantees that a given network identity will + always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/authentication/__init__.py b/k8s/models/v1_11/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/authentication/v1.py b/k8s/models/v1_11/api/authentication/v1.py new file mode 100644 index 0000000..990e906 --- /dev/null +++ b/k8s/models/v1_11/api/authentication/v1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_11/api/authentication/v1beta1.py b/k8s/models/v1_11/api/authentication/v1beta1.py new file mode 100644 index 0000000..b69a521 --- /dev/null +++ b/k8s/models/v1_11/api/authentication/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_11/api/authorization/__init__.py b/k8s/models/v1_11/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/authorization/v1.py b/k8s/models/v1_11/api/authorization/v1.py new file mode 100644 index 0000000..9e4aaa8 --- /dev/null +++ b/k8s/models/v1_11/api/authorization/v1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_11/api/authorization/v1beta1.py b/k8s/models/v1_11/api/authorization/v1beta1.py new file mode 100644 index 0000000..e40bbe7 --- /dev/null +++ b/k8s/models/v1_11/api/authorization/v1beta1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_11/api/autoscaling/__init__.py b/k8s/models/v1_11/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/autoscaling/v1.py b/k8s/models/v1_11/api/autoscaling/v1.py new file mode 100644 index 0000000..2e5d579 --- /dev/null +++ b/k8s/models/v1_11/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/autoscaling/v2beta1.py b/k8s/models/v1_11/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..f0f53aa --- /dev/null +++ b/k8s/models/v1_11/api/autoscaling/v2beta1.py @@ -0,0 +1,228 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + currentAverageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). Exactly one 'target' type + should be set. + """ + + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + targetAverageValue = Field(six.text_type) + targetValue = Field(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/batch/__init__.py b/k8s/models/v1_11/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/batch/v1.py b/k8s/models/v1_11/api/batch/v1.py new file mode 100644 index 0000000..3404e12 --- /dev/null +++ b/k8s/models/v1_11/api/batch/v1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.core.v1 import PodTemplateSpec +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/batch/v1beta1.py b/k8s/models/v1_11/api/batch/v1beta1.py new file mode 100644 index 0000000..36030bc --- /dev/null +++ b/k8s/models/v1_11/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.batch.v1 import JobSpec +from k8s.models.v1_11.api.core.v1 import ObjectReference +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/batch/v2alpha1.py b/k8s/models/v1_11/api/batch/v2alpha1.py new file mode 100644 index 0000000..58377fc --- /dev/null +++ b/k8s/models/v1_11/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.batch.v1 import JobSpec +from k8s.models.v1_11.api.core.v1 import ObjectReference +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/certificates/__init__.py b/k8s/models/v1_11/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/certificates/v1beta1.py b/k8s/models/v1_11/api/certificates/v1beta1.py new file mode 100644 index 0000000..7e1009b --- /dev/null +++ b/k8s/models/v1_11/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/core/__init__.py b/k8s/models/v1_11/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/core/v1.py b/k8s/models/v1_11/api/core/v1.py new file mode 100644 index 0000000..211001c --- /dev/null +++ b/k8s/models/v1_11/api/core/v1.py @@ -0,0 +1,2374 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class VolumeDevice(Model): + """ + volumeDevice describes a mapping of a raw block device within a container. + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class TopologySelectorLabelRequirement(Model): + """ + A topology selector requirement is a selector that matches given label. This is + an alpha feature and may change in the future. + """ + + key = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class TopologySelectorTerm(Model): + """ + A topology selector term represents the result of label queries. A null or + empty topology selector term matches no objects. The requirements of them are + ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an + alpha feature and may change in the future. + """ + + matchLabelExpressions = ListField(TopologySelectorLabelRequirement) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class Sysctl(Model): + """ + Sysctl defines a kernel parameter to be set + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class ServiceAccountTokenProjection(Model): + """ + ServiceAccountTokenProjection represents a projected service account token + volume. This projection can be used to insert a service account token into the + pods runtime filesystem for use against APIs (Kubernetes API Server or + otherwise). + """ + + audience = Field(six.text_type) + expirationSeconds = Field(int) + path = RequiredField(six.text_type) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDPersistentVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class ISCSIPersistentVolumeSource(Model): + """ + ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be + mounted as read/write once. ISCSI volumes support ownership management and + SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + targetPortal = RequiredField(six.text_type) + + +class FlexPersistentVolumeSource(Model): + """ + FlexPersistentVolumeSource represents a generic persistent volume resource that + is provisioned/attached using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(SecretReference) + + +class CinderPersistentVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + volumeID = RequiredField(six.text_type) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class CSIPersistentVolumeSource(Model): + """ + Represents storage that is managed by an external CSI volume driver (Beta + feature) + """ + + controllerPublishSecretRef = Field(SecretReference) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + nodePublishSecretRef = Field(SecretReference) + nodeStageSecretRef = Field(SecretReference) + readOnly = Field(bool) + volumeAttributes = Field(dict) + volumeHandle = RequiredField(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class ScopedResourceSelectorRequirement(Model): + """ + A scoped-resource selector requirement is a selector that contains values, a + scope name, and an operator that relates the scope name and values. + """ + + operator = RequiredField(six.text_type) + scopeName = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class ScopeSelector(Model): + """ + A scope selector represents the AND of the selectors represented by the scoped- + resource selector requirements. + """ + + matchExpressions = ListField(ScopedResourceSelectorRequirement) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopeSelector = Field(ScopeSelector) + scopes = ListField(six.text_type) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + sysctls = ListField(Sysctl) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeMode = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodReadinessGate(Model): + """ + PodReadinessGate contains the reference to a pod condition + """ + + conditionType = RequiredField(six.text_type) + + +class PodDNSConfigOption(Model): + """ + PodDNSConfigOption defines DNS resolver options of a pod. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class PodDNSConfig(Model): + """ + PodDNSConfig defines the DNS parameters of a pod in addition to those generated + from DNSPolicy. + """ + + nameservers = ListField(six.text_type) + options = ListField(PodDNSConfigOption) + searches = ListField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key matches that of any node on + which a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = RequiredField(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + matchFields = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class VolumeNodeAffinity(Model): + """ + VolumeNodeAffinity defines constraints that limit what nodes this volume can be + accessed from. + """ + + required = Field(NodeSelector) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity (Beta feature) + """ + + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeID = RequiredField(six.text_type) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + serviceAccountToken = Field(ServiceAccountTokenProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + + DEPRECATED: GitRepo is deprecated. To provision a + container with a git repo, mount an EmptyDir into an InitContainer that clones + the repo using git, then mount the EmptyDir into the Pod's container. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = Field(int) + lastObservedTime = Field(datetime.datetime) + state = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + count = Field(int) + eventTime = Field(datetime.datetime) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + related = Field(ObjectReference) + reportingComponent = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system, especially if the node that hosts the pod cannot + contact the control plane. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + nominatedNodeName = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapNodeConfigSource(Model): + """ + ConfigMapNodeConfigSource contains the information to reference a ConfigMap as + a config source for the Node. + """ + + kubeletConfigKey = RequiredField(six.text_type) + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + + configMap = Field(ConfigMapNodeConfigSource) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class NodeConfigStatus(Model): + """ + NodeConfigStatus describes the status of the config assigned by + Node.Spec.ConfigSource. + """ + + active = Field(NodeConfigSource) + assigned = Field(NodeConfigSource) + error = Field(six.text_type) + lastKnownGood = Field(NodeConfigSource) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + binaryData = Field(dict) + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeDevices = ListField(VolumeDevice) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + config = Field(NodeConfigStatus) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsConfig = Field(PodDNSConfig) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + readinessGates = ListField(PodReadinessGate) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + shareProcessNamespace = Field(bool) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderPersistentVolumeSource) + claimRef = Field(ObjectReference) + csi = Field(CSIPersistentVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexPersistentVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIPersistentVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + nodeAffinity = Field(VolumeNodeAffinity) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDPersistentVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + volumeMode = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/events/__init__.py b/k8s/models/v1_11/api/events/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/events/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/events/v1beta1.py b/k8s/models/v1_11/api/events/v1beta1.py new file mode 100644 index 0000000..9f714d7 --- /dev/null +++ b/k8s/models/v1_11/api/events/v1beta1.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.core.v1 import EventSource, ObjectReference +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = RequiredField(int) + lastObservedTime = RequiredField(datetime.datetime) + state = RequiredField(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. It generally denotes + some state change in the system. + """ + class Meta: + create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + get_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + list_all_url = "/apis/events.k8s.io/v1beta1/events" + list_ns_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + update_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" + watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + deprecatedCount = Field(int) + deprecatedFirstTimestamp = Field(datetime.datetime) + deprecatedLastTimestamp = Field(datetime.datetime) + deprecatedSource = Field(EventSource) + eventTime = RequiredField(datetime.datetime) + metadata = Field(ObjectMeta) + note = Field(six.text_type) + reason = Field(six.text_type) + regarding = Field(ObjectReference) + related = Field(ObjectReference) + reportingController = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of Event objects. + """ + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/extensions/__init__.py b/k8s/models/v1_11/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/extensions/v1beta1.py b/k8s/models/v1_11/api/extensions/v1beta1.py new file mode 100644 index 0000000..17e43f3 --- /dev/null +++ b/k8s/models/v1_11/api/extensions/v1beta1.py @@ -0,0 +1,696 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. Deprecated: use SELinuxStrategyOptions from policy API Group + instead. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by + networking/v1/NetworkPolicyPort. + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + DEPRECATED 1.9 - This group version of IPBlock is deprecated by + networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. + '192.168.1.1/24') that is allowed to the pods matched by a NetworkPolicySpec's + podSelector. The except entry describes CIDRs that should not be included + within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by + networking/v1/NetworkPolicyPeer. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated + by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule + matches traffic if and only if the traffic matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by + networking/v1/NetworkPolicyEgressRule. NetworkPolicyEgressRule describes a + particular set of traffic that is allowed out of pods matched by a + NetworkPolicySpec's podSelector. The traffic must match both ports and to. This + type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by + networking/v1/NetworkPolicySpec. + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by + networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is + allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by + networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy + objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange + from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. Deprecated: use SupplementalGroupsStrategyOptions from + policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. Deprecated: use RunAsUserStrategyOptions from policy API + Group instead. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. Deprecated: use FSGroupStrategyOptions from policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. Deprecated: + use HostPortRange from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. Deprecated: + use AllowedHostPath from policy API Group instead. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + Deprecated: use AllowedFlexVolume from policy API Group instead. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. Deprecated: use + PodSecurityPolicySpec from policy API Group instead. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. Deprecated: use + PodSecurityPolicy from policy API Group instead. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. Deprecated: use + PodSecurityPolicyList from policy API Group instead. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/networking/__init__.py b/k8s/models/v1_11/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/networking/v1.py b/k8s/models/v1_11/api/networking/v1.py new file mode 100644 index 0000000..00bd108 --- /dev/null +++ b/k8s/models/v1_11/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Only certain + combinations of fields are allowed + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/policy/__init__.py b/k8s/models/v1_11/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/policy/v1beta1.py b/k8s/models/v1_11/api/policy/v1beta1.py new file mode 100644 index 0000000..bf6db39 --- /dev/null +++ b/k8s/models/v1_11/api/policy/v1beta1.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.core.v1 import SELinuxOptions +from k8s.models.v1_11.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/policy/v1beta1/podsecuritypolicies" + delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/policy/v1beta1/podsecuritypolicies" + update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/rbac/__init__.py b/k8s/models/v1_11/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/rbac/v1.py b/k8s/models/v1_11/api/rbac/v1.py new file mode 100644 index 0000000..8c1df4b --- /dev/null +++ b/k8s/models/v1_11/api/rbac/v1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/rbac/v1alpha1.py b/k8s/models/v1_11/api/rbac/v1alpha1.py new file mode 100644 index 0000000..a305975 --- /dev/null +++ b/k8s/models/v1_11/api/rbac/v1alpha1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/rbac/v1beta1.py b/k8s/models/v1_11/api/rbac/v1beta1.py new file mode 100644 index 0000000..ba7fcdd --- /dev/null +++ b/k8s/models/v1_11/api/rbac/v1beta1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/scheduling/__init__.py b/k8s/models/v1_11/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/scheduling/v1alpha1.py b/k8s/models/v1_11/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..6593b64 --- /dev/null +++ b/k8s/models/v1_11/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/scheduling/v1beta1.py b/k8s/models/v1_11/api/scheduling/v1beta1.py new file mode 100644 index 0000000..0b7b9db --- /dev/null +++ b/k8s/models/v1_11/api/scheduling/v1beta1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/settings/__init__.py b/k8s/models/v1_11/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/settings/v1alpha1.py b/k8s/models/v1_11/api/settings/v1alpha1.py new file mode 100644 index 0000000..3c9f561 --- /dev/null +++ b/k8s/models/v1_11/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_11.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_11.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/storage/__init__.py b/k8s/models/v1_11/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/api/storage/v1.py b/k8s/models/v1_11/api/storage/v1.py new file mode 100644 index 0000000..c9d137a --- /dev/null +++ b/k8s/models/v1_11/api/storage/v1.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/storage/v1alpha1.py b/k8s/models/v1_11/api/storage/v1alpha1.py new file mode 100644 index 0000000..8e9ea28 --- /dev/null +++ b/k8s/models/v1_11/api/storage/v1alpha1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/api/storage/v1beta1.py b/k8s/models/v1_11/api/storage/v1beta1.py new file mode 100644 index 0000000..c00b452 --- /dev/null +++ b/k8s/models/v1_11/api/storage/v1beta1.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/apiextensions_apiserver/__init__.py b/k8s/models/v1_11/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_11/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..2c80630 --- /dev/null +++ b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + +class CustomResourceSubresourceScale(Model): + """ + CustomResourceSubresourceScale defines how to serve the scale subresource for + CustomResources. + """ + + labelSelectorPath = Field(six.text_type) + specReplicasPath = RequiredField(six.text_type) + statusReplicasPath = RequiredField(six.text_type) + + +class CustomResourceSubresources(Model): + """ + CustomResourceSubresources defines the status and scale subresources for + CustomResources. + """ + + scale = Field(CustomResourceSubresourceScale) + status = Field(dict) + + +class CustomResourceDefinitionVersion(Model): + """ + + """ + + name = RequiredField(six.text_type) + served = RequiredField(bool) + storage = RequiredField(bool) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + categories = ListField(six.text_type) + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + storedVersions = ListField(six.text_type) + + +class CustomResourceColumnDefinition(Model): + """ + CustomResourceColumnDefinition specifies a column for server side printing. + """ + + JSONPath = RequiredField(six.text_type) + description = Field(six.text_type) + format = Field(six.text_type) + name = RequiredField(six.text_type) + priority = Field(int) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + additionalPrinterColumns = ListField(CustomResourceColumnDefinition) + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + subresources = Field(CustomResourceSubresources) + validation = Field(CustomResourceValidation) + version = Field(six.text_type) + versions = ListField(CustomResourceDefinitionVersion) + + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = Field(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/apimachinery/__init__.py b/k8s/models/v1_11/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apimachinery/apis/__init__.py b/k8s/models/v1_11/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apimachinery/apis/meta/__init__.py b/k8s/models/v1_11/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/apimachinery/apis/meta/v1.py b/k8s/models/v1_11/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..b39461c --- /dev/null +++ b/k8s/models/v1_11/apimachinery/apis/meta/v1.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_11.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_11/apimachinery/runtime.py b/k8s/models/v1_11/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_11/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_11/apimachinery/version.py b/k8s/models/v1_11/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_11/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_11/kube_aggregator/__init__.py b/k8s/models/v1_11/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/kube_aggregator/apis/__init__.py b/k8s/models/v1_11/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py new file mode 100644 index 0000000..04a1266 --- /dev/null +++ b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..7eadd70 --- /dev/null +++ b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_11.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/__init__.py b/k8s/models/v1_12/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/__init__.py b/k8s/models/v1_12/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/admissionregistration/__init__.py b/k8s/models/v1_12/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/admissionregistration/v1alpha1.py b/k8s/models/v1_12/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..c06d376 --- /dev/null +++ b/k8s/models/v1_12/api/admissionregistration/v1alpha1.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/admissionregistration/v1beta1.py b/k8s/models/v1_12/api/admissionregistration/v1beta1.py new file mode 100644 index 0000000..a649f6a --- /dev/null +++ b/k8s/models/v1_12/api/admissionregistration/v1beta1.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook + """ + + caBundle = RequiredField(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Webhook(Model): + """ + Webhook describes an admission webhook and the resources and operations it + applies to. + """ + + clientConfig = RequiredField(WebhookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + namespaceSelector = Field(LabelSelector) + rules = ListField(RuleWithOperations) + sideEffects = Field(six.text_type) + + +class ValidatingWebhookConfiguration(Model): + """ + ValidatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and object without changing it. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class ValidatingWebhookConfigurationList(Model): + """ + ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfigurationList") + + items = ListField(ValidatingWebhookConfiguration) + metadata = Field(ListMeta) + + +class MutatingWebhookConfiguration(Model): + """ + MutatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and may change the object. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class MutatingWebhookConfigurationList(Model): + """ + MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfigurationList") + + items = ListField(MutatingWebhookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/apps/__init__.py b/k8s/models/v1_12/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/apps/v1.py b/k8s/models/v1_12/api/apps/v1.py new file mode 100644 index 0000000..f31531c --- /dev/null +++ b/k8s/models/v1_12/api/apps/v1.py @@ -0,0 +1,427 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_12.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1/statefulsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet ensures that a specified number of pod replicas are running at any + given time. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1/replicasets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1/deployments" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1/daemonsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1/controllerrevisions" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/apps/v1beta1.py b/k8s/models/v1_12/api/apps/v1beta1.py new file mode 100644 index 0000000..d5b6255 --- /dev/null +++ b/k8s/models/v1_12/api/apps/v1beta1.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_12.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/apps/v1beta2.py b/k8s/models/v1_12/api/apps/v1beta2.py new file mode 100644 index 0000000..2dbd764 --- /dev/null +++ b/k8s/models/v1_12/api/apps/v1beta2.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_12.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1/StatefulSet. See the release notes for more information. StatefulSet + represents a set of pods with consistent identities. Identities are defined as: + - Network: A single stable DNS and hostname. + - Storage: As many VolumeClaims + as requested. + The StatefulSet guarantees that a given network identity will + always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/authentication/__init__.py b/k8s/models/v1_12/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/authentication/v1.py b/k8s/models/v1_12/api/authentication/v1.py new file mode 100644 index 0000000..1085ddb --- /dev/null +++ b/k8s/models/v1_12/api/authentication/v1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_12/api/authentication/v1beta1.py b/k8s/models/v1_12/api/authentication/v1beta1.py new file mode 100644 index 0000000..1c91850 --- /dev/null +++ b/k8s/models/v1_12/api/authentication/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_12/api/authorization/__init__.py b/k8s/models/v1_12/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/authorization/v1.py b/k8s/models/v1_12/api/authorization/v1.py new file mode 100644 index 0000000..00af195 --- /dev/null +++ b/k8s/models/v1_12/api/authorization/v1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_12/api/authorization/v1beta1.py b/k8s/models/v1_12/api/authorization/v1beta1.py new file mode 100644 index 0000000..8085551 --- /dev/null +++ b/k8s/models/v1_12/api/authorization/v1beta1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_12/api/autoscaling/__init__.py b/k8s/models/v1_12/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/autoscaling/v1.py b/k8s/models/v1_12/api/autoscaling/v1.py new file mode 100644 index 0000000..653f1a3 --- /dev/null +++ b/k8s/models/v1_12/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/autoscaling/v2beta1.py b/k8s/models/v1_12/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..a532d5f --- /dev/null +++ b/k8s/models/v1_12/api/autoscaling/v2beta1.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + currentAverageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). Exactly one 'target' type + should be set. + """ + + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + targetAverageValue = Field(six.text_type) + targetValue = Field(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + averageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + averageValue = Field(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/autoscaling/v2beta2.py b/k8s/models/v1_12/api/autoscaling/v2beta2.py new file mode 100644 index 0000000..76f74d7 --- /dev/null +++ b/k8s/models/v1_12/api/autoscaling/v2beta2.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class MetricValueStatus(Model): + """ + MetricValueStatus holds the current value for a metric + """ + + averageUtilization = Field(int) + averageValue = Field(six.text_type) + value = Field(six.text_type) + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + current = RequiredField(MetricValueStatus) + name = RequiredField(six.text_type) + + +class MetricTarget(Model): + """ + MetricTarget defines the target value, average value, or average utilization of + a specific metric + """ + + averageUtilization = Field(int) + averageValue = Field(six.text_type) + type = RequiredField(six.text_type) + value = Field(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + target = RequiredField(MetricTarget) + + +class MetricIdentifier(Model): + """ + MetricIdentifier defines the name and optionally selector for a metric + """ + + name = RequiredField(six.text_type) + selector = Field(LabelSelector) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + current = RequiredField(MetricValueStatus) + metric = RequiredField(MetricIdentifier) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + current = RequiredField(MetricValueStatus) + metric = RequiredField(MetricIdentifier) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). + """ + + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + current = RequiredField(MetricValueStatus) + describedObject = RequiredField(CrossVersionObjectReference) + metric = RequiredField(MetricIdentifier) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + describedObject = RequiredField(CrossVersionObjectReference) + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta2/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta2") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta2") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/batch/__init__.py b/k8s/models/v1_12/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/batch/v1.py b/k8s/models/v1_12/api/batch/v1.py new file mode 100644 index 0000000..ad963f4 --- /dev/null +++ b/k8s/models/v1_12/api/batch/v1.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.core.v1 import PodTemplateSpec +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + ttlSecondsAfterFinished = Field(int) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/batch/v1beta1.py b/k8s/models/v1_12/api/batch/v1beta1.py new file mode 100644 index 0000000..2d79f66 --- /dev/null +++ b/k8s/models/v1_12/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.batch.v1 import JobSpec +from k8s.models.v1_12.api.core.v1 import ObjectReference +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/batch/v2alpha1.py b/k8s/models/v1_12/api/batch/v2alpha1.py new file mode 100644 index 0000000..a787439 --- /dev/null +++ b/k8s/models/v1_12/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.batch.v1 import JobSpec +from k8s.models.v1_12.api.core.v1 import ObjectReference +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/certificates/__init__.py b/k8s/models/v1_12/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/certificates/v1beta1.py b/k8s/models/v1_12/api/certificates/v1beta1.py new file mode 100644 index 0000000..205e69e --- /dev/null +++ b/k8s/models/v1_12/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/coordination/__init__.py b/k8s/models/v1_12/api/coordination/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/coordination/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/coordination/v1beta1.py b/k8s/models/v1_12/api/coordination/v1beta1.py new file mode 100644 index 0000000..427bc05 --- /dev/null +++ b/k8s/models/v1_12/api/coordination/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class LeaseSpec(Model): + """ + LeaseSpec is a specification of a Lease. + """ + + acquireTime = Field(datetime.datetime) + holderIdentity = Field(six.text_type) + leaseDurationSeconds = Field(int) + leaseTransitions = Field(int) + renewTime = Field(datetime.datetime) + + +class Lease(Model): + """ + Lease defines a lease concept. + """ + class Meta: + create_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" + delete_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + get_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + list_all_url = "/apis/coordination.k8s.io/v1beta1/leases" + list_ns_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" + update_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + watch_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases/{name}" + watchlist_all_url = "/apis/coordination.k8s.io/v1beta1/watch/leases" + watchlist_ns_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases" + + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") + kind = Field(six.text_type, "Lease") + + metadata = Field(ObjectMeta) + spec = Field(LeaseSpec) + + +class LeaseList(Model): + """ + LeaseList is a list of Lease objects. + """ + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") + kind = Field(six.text_type, "LeaseList") + + items = ListField(Lease) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/core/__init__.py b/k8s/models/v1_12/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/core/v1.py b/k8s/models/v1_12/api/core/v1.py new file mode 100644 index 0000000..b53c83c --- /dev/null +++ b/k8s/models/v1_12/api/core/v1.py @@ -0,0 +1,2388 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class VolumeDevice(Model): + """ + volumeDevice describes a mapping of a raw block device within a container. + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class TypedLocalObjectReference(Model): + """ + TypedLocalObjectReference contains enough information to let you locate the + typed referenced object inside the same namespace. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + + +class TopologySelectorLabelRequirement(Model): + """ + A topology selector requirement is a selector that matches given label. This is + an alpha feature and may change in the future. + """ + + key = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class TopologySelectorTerm(Model): + """ + A topology selector term represents the result of label queries. A null or + empty topology selector term matches no objects. The requirements of them are + ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an + alpha feature and may change in the future. + """ + + matchLabelExpressions = ListField(TopologySelectorLabelRequirement) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class Sysctl(Model): + """ + Sysctl defines a kernel parameter to be set + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class ServiceAccountTokenProjection(Model): + """ + ServiceAccountTokenProjection represents a projected service account token + volume. This projection can be used to insert a service account token into the + pods runtime filesystem for use against APIs (Kubernetes API Server or + otherwise). + """ + + audience = Field(six.text_type) + expirationSeconds = Field(int) + path = RequiredField(six.text_type) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDPersistentVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class ISCSIPersistentVolumeSource(Model): + """ + ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be + mounted as read/write once. ISCSI volumes support ownership management and + SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + targetPortal = RequiredField(six.text_type) + + +class FlexPersistentVolumeSource(Model): + """ + FlexPersistentVolumeSource represents a generic persistent volume resource that + is provisioned/attached using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(SecretReference) + + +class CinderPersistentVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + volumeID = RequiredField(six.text_type) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class CSIPersistentVolumeSource(Model): + """ + Represents storage that is managed by an external CSI volume driver (Beta + feature) + """ + + controllerPublishSecretRef = Field(SecretReference) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + nodePublishSecretRef = Field(SecretReference) + nodeStageSecretRef = Field(SecretReference) + readOnly = Field(bool) + volumeAttributes = Field(dict) + volumeHandle = RequiredField(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class ScopedResourceSelectorRequirement(Model): + """ + A scoped-resource selector requirement is a selector that contains values, a + scope name, and an operator that relates the scope name and values. + """ + + operator = RequiredField(six.text_type) + scopeName = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class ScopeSelector(Model): + """ + A scope selector represents the AND of the selectors represented by the scoped- + resource selector requirements. + """ + + matchExpressions = ListField(ScopedResourceSelectorRequirement) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopeSelector = Field(ScopeSelector) + scopes = ListField(six.text_type) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + sysctls = ListField(Sysctl) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + dataSource = Field(TypedLocalObjectReference) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeMode = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodReadinessGate(Model): + """ + PodReadinessGate contains the reference to a pod condition + """ + + conditionType = RequiredField(six.text_type) + + +class PodDNSConfigOption(Model): + """ + PodDNSConfigOption defines DNS resolver options of a pod. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class PodDNSConfig(Model): + """ + PodDNSConfig defines the DNS parameters of a pod in addition to those generated + from DNSPolicy. + """ + + nameservers = ListField(six.text_type) + options = ListField(PodDNSConfigOption) + searches = ListField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key matches that of any node on + which a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = RequiredField(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + matchFields = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class VolumeNodeAffinity(Model): + """ + VolumeNodeAffinity defines constraints that limit what nodes this volume can be + accessed from. + """ + + required = Field(NodeSelector) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity (Beta feature) + """ + + fsType = Field(six.text_type) + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeID = RequiredField(six.text_type) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + serviceAccountToken = Field(ServiceAccountTokenProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + + DEPRECATED: GitRepo is deprecated. To provision a + container with a git repo, mount an EmptyDir into an InitContainer that clones + the repo using git, then mount the EmptyDir into the Pod's container. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = Field(int) + lastObservedTime = Field(datetime.datetime) + state = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + count = Field(int) + eventTime = Field(datetime.datetime) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + related = Field(ObjectReference) + reportingComponent = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system, especially if the node that hosts the pod cannot + contact the control plane. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + nominatedNodeName = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapNodeConfigSource(Model): + """ + ConfigMapNodeConfigSource contains the information to reference a ConfigMap as + a config source for the Node. + """ + + kubeletConfigKey = RequiredField(six.text_type) + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + + configMap = Field(ConfigMapNodeConfigSource) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class NodeConfigStatus(Model): + """ + NodeConfigStatus describes the status of the config assigned by + Node.Spec.ConfigSource. + """ + + active = Field(NodeConfigSource) + assigned = Field(NodeConfigSource) + error = Field(six.text_type) + lastKnownGood = Field(NodeConfigSource) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + binaryData = Field(dict) + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + procMount = Field(six.text_type) + readOnlyRootFilesystem = Field(bool) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeDevices = ListField(VolumeDevice) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + config = Field(NodeConfigStatus) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsConfig = Field(PodDNSConfig) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + readinessGates = ListField(PodReadinessGate) + restartPolicy = Field(six.text_type) + runtimeClassName = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + shareProcessNamespace = Field(bool) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderPersistentVolumeSource) + claimRef = Field(ObjectReference) + csi = Field(CSIPersistentVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexPersistentVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIPersistentVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + nodeAffinity = Field(VolumeNodeAffinity) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDPersistentVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + volumeMode = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/events/__init__.py b/k8s/models/v1_12/api/events/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/events/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/events/v1beta1.py b/k8s/models/v1_12/api/events/v1beta1.py new file mode 100644 index 0000000..2a2dd64 --- /dev/null +++ b/k8s/models/v1_12/api/events/v1beta1.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.core.v1 import EventSource, ObjectReference +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = RequiredField(int) + lastObservedTime = RequiredField(datetime.datetime) + state = RequiredField(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. It generally denotes + some state change in the system. + """ + class Meta: + create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + get_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + list_all_url = "/apis/events.k8s.io/v1beta1/events" + list_ns_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + update_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" + watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + deprecatedCount = Field(int) + deprecatedFirstTimestamp = Field(datetime.datetime) + deprecatedLastTimestamp = Field(datetime.datetime) + deprecatedSource = Field(EventSource) + eventTime = RequiredField(datetime.datetime) + metadata = Field(ObjectMeta) + note = Field(six.text_type) + reason = Field(six.text_type) + regarding = Field(ObjectReference) + related = Field(ObjectReference) + reportingController = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of Event objects. + """ + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/extensions/__init__.py b/k8s/models/v1_12/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/extensions/v1beta1.py b/k8s/models/v1_12/api/extensions/v1beta1.py new file mode 100644 index 0000000..12e86e7 --- /dev/null +++ b/k8s/models/v1_12/api/extensions/v1beta1.py @@ -0,0 +1,697 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. Deprecated: use SELinuxStrategyOptions from policy API Group + instead. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by + networking/v1/NetworkPolicyPort. + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + DEPRECATED 1.9 - This group version of IPBlock is deprecated by + networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. + '192.168.1.1/24') that is allowed to the pods matched by a NetworkPolicySpec's + podSelector. The except entry describes CIDRs that should not be included + within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by + networking/v1/NetworkPolicyPeer. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated + by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule + matches traffic if and only if the traffic matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by + networking/v1/NetworkPolicyEgressRule. NetworkPolicyEgressRule describes a + particular set of traffic that is allowed out of pods matched by a + NetworkPolicySpec's podSelector. The traffic must match both ports and to. This + type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by + networking/v1/NetworkPolicySpec. + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by + networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is + allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by + networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy + objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange + from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. Deprecated: use SupplementalGroupsStrategyOptions from + policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. Deprecated: use RunAsUserStrategyOptions from policy API + Group instead. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. Deprecated: use FSGroupStrategyOptions from policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. Deprecated: + use HostPortRange from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. Deprecated: + use AllowedHostPath from policy API Group instead. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + Deprecated: use AllowedFlexVolume from policy API Group instead. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. Deprecated: use + PodSecurityPolicySpec from policy API Group instead. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedProcMountTypes = ListField(six.text_type) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. Deprecated: use + PodSecurityPolicy from policy API Group instead. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. Deprecated: use + PodSecurityPolicyList from policy API Group instead. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/networking/__init__.py b/k8s/models/v1_12/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/networking/v1.py b/k8s/models/v1_12/api/networking/v1.py new file mode 100644 index 0000000..e37e8c9 --- /dev/null +++ b/k8s/models/v1_12/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Only certain + combinations of fields are allowed + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/policy/__init__.py b/k8s/models/v1_12/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/policy/v1beta1.py b/k8s/models/v1_12/api/policy/v1beta1.py new file mode 100644 index 0000000..65d4b52 --- /dev/null +++ b/k8s/models/v1_12/api/policy/v1beta1.py @@ -0,0 +1,231 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.core.v1 import SELinuxOptions +from k8s.models.v1_12.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = Field(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedProcMountTypes = ListField(six.text_type) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/policy/v1beta1/podsecuritypolicies" + delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/policy/v1beta1/podsecuritypolicies" + update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/rbac/__init__.py b/k8s/models/v1_12/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/rbac/v1.py b/k8s/models/v1_12/api/rbac/v1.py new file mode 100644 index 0000000..384c68f --- /dev/null +++ b/k8s/models/v1_12/api/rbac/v1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/rbac/v1alpha1.py b/k8s/models/v1_12/api/rbac/v1alpha1.py new file mode 100644 index 0000000..7afa16a --- /dev/null +++ b/k8s/models/v1_12/api/rbac/v1alpha1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/rbac/v1beta1.py b/k8s/models/v1_12/api/rbac/v1beta1.py new file mode 100644 index 0000000..678aabb --- /dev/null +++ b/k8s/models/v1_12/api/rbac/v1beta1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/scheduling/__init__.py b/k8s/models/v1_12/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/scheduling/v1alpha1.py b/k8s/models/v1_12/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..2cda012 --- /dev/null +++ b/k8s/models/v1_12/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/scheduling/v1beta1.py b/k8s/models/v1_12/api/scheduling/v1beta1.py new file mode 100644 index 0000000..7a8e0d4 --- /dev/null +++ b/k8s/models/v1_12/api/scheduling/v1beta1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/settings/__init__.py b/k8s/models/v1_12/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/settings/v1alpha1.py b/k8s/models/v1_12/api/settings/v1alpha1.py new file mode 100644 index 0000000..30bbda4 --- /dev/null +++ b/k8s/models/v1_12/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_12.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_12.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/storage/__init__.py b/k8s/models/v1_12/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/api/storage/v1.py b/k8s/models/v1_12/api/storage/v1.py new file mode 100644 index 0000000..9be2e91 --- /dev/null +++ b/k8s/models/v1_12/api/storage/v1.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/storage/v1alpha1.py b/k8s/models/v1_12/api/storage/v1alpha1.py new file mode 100644 index 0000000..4d4b1cc --- /dev/null +++ b/k8s/models/v1_12/api/storage/v1alpha1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/api/storage/v1beta1.py b/k8s/models/v1_12/api/storage/v1beta1.py new file mode 100644 index 0000000..f1e1269 --- /dev/null +++ b/k8s/models/v1_12/api/storage/v1beta1.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/apiextensions_apiserver/__init__.py b/k8s/models/v1_12/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_12/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..0b599bc --- /dev/null +++ b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,168 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + +class CustomResourceSubresourceScale(Model): + """ + CustomResourceSubresourceScale defines how to serve the scale subresource for + CustomResources. + """ + + labelSelectorPath = Field(six.text_type) + specReplicasPath = RequiredField(six.text_type) + statusReplicasPath = RequiredField(six.text_type) + + +class CustomResourceSubresources(Model): + """ + CustomResourceSubresources defines the status and scale subresources for + CustomResources. + """ + + scale = Field(CustomResourceSubresourceScale) + status = Field(dict) + + +class CustomResourceDefinitionVersion(Model): + """ + + """ + + name = RequiredField(six.text_type) + served = RequiredField(bool) + storage = RequiredField(bool) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + categories = ListField(six.text_type) + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + storedVersions = ListField(six.text_type) + + +class CustomResourceColumnDefinition(Model): + """ + CustomResourceColumnDefinition specifies a column for server side printing. + """ + + JSONPath = RequiredField(six.text_type) + description = Field(six.text_type) + format = Field(six.text_type) + name = RequiredField(six.text_type) + priority = Field(int) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + additionalPrinterColumns = ListField(CustomResourceColumnDefinition) + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + subresources = Field(CustomResourceSubresources) + validation = Field(CustomResourceValidation) + version = Field(six.text_type) + versions = ListField(CustomResourceDefinitionVersion) + + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = RequiredField(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/apimachinery/__init__.py b/k8s/models/v1_12/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apimachinery/apis/__init__.py b/k8s/models/v1_12/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apimachinery/apis/meta/__init__.py b/k8s/models/v1_12/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/apimachinery/apis/meta/v1.py b/k8s/models/v1_12/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..4dcc21d --- /dev/null +++ b/k8s/models/v1_12/apimachinery/apis/meta/v1.py @@ -0,0 +1,269 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_12.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + dryRun = ListField(six.text_type) + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_12/apimachinery/runtime.py b/k8s/models/v1_12/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_12/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_12/apimachinery/version.py b/k8s/models/v1_12/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_12/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_12/kube_aggregator/__init__.py b/k8s/models/v1_12/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/kube_aggregator/apis/__init__.py b/k8s/models/v1_12/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py new file mode 100644 index 0000000..3699208 --- /dev/null +++ b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..c376094 --- /dev/null +++ b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_12.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/__init__.py b/k8s/models/v1_13/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/__init__.py b/k8s/models/v1_13/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/admissionregistration/__init__.py b/k8s/models/v1_13/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/admissionregistration/v1alpha1.py b/k8s/models/v1_13/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..a9fae38 --- /dev/null +++ b/k8s/models/v1_13/api/admissionregistration/v1alpha1.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/admissionregistration/v1beta1.py b/k8s/models/v1_13/api/admissionregistration/v1beta1.py new file mode 100644 index 0000000..7390ac3 --- /dev/null +++ b/k8s/models/v1_13/api/admissionregistration/v1beta1.py @@ -0,0 +1,129 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook + """ + + caBundle = Field(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Webhook(Model): + """ + Webhook describes an admission webhook and the resources and operations it + applies to. + """ + + clientConfig = RequiredField(WebhookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + namespaceSelector = Field(LabelSelector) + rules = ListField(RuleWithOperations) + sideEffects = Field(six.text_type) + + +class ValidatingWebhookConfiguration(Model): + """ + ValidatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and object without changing it. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class ValidatingWebhookConfigurationList(Model): + """ + ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfigurationList") + + items = ListField(ValidatingWebhookConfiguration) + metadata = Field(ListMeta) + + +class MutatingWebhookConfiguration(Model): + """ + MutatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and may change the object. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class MutatingWebhookConfigurationList(Model): + """ + MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfigurationList") + + items = ListField(MutatingWebhookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/apps/__init__.py b/k8s/models/v1_13/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/apps/v1.py b/k8s/models/v1_13/api/apps/v1.py new file mode 100644 index 0000000..091872b --- /dev/null +++ b/k8s/models/v1_13/api/apps/v1.py @@ -0,0 +1,427 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_13.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1/statefulsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet ensures that a specified number of pod replicas are running at any + given time. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1/replicasets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1/deployments" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1/daemonsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1/controllerrevisions" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/apps/v1beta1.py b/k8s/models/v1_13/api/apps/v1beta1.py new file mode 100644 index 0000000..830cea2 --- /dev/null +++ b/k8s/models/v1_13/api/apps/v1beta1.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_13.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/apps/v1beta2.py b/k8s/models/v1_13/api/apps/v1beta2.py new file mode 100644 index 0000000..73be75d --- /dev/null +++ b/k8s/models/v1_13/api/apps/v1beta2.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_13.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1/StatefulSet. See the release notes for more information. StatefulSet + represents a set of pods with consistent identities. Identities are defined as: + - Network: A single stable DNS and hostname. + - Storage: As many VolumeClaims + as requested. + The StatefulSet guarantees that a given network identity will + always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/auditregistration/__init__.py b/k8s/models/v1_13/api/auditregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/auditregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/auditregistration/v1alpha1.py b/k8s/models/v1_13/api/auditregistration/v1alpha1.py new file mode 100644 index 0000000..3437968 --- /dev/null +++ b/k8s/models/v1_13/api/auditregistration/v1alpha1.py @@ -0,0 +1,106 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WebhookThrottleConfig(Model): + """ + WebhookThrottleConfig holds the configuration for throttling events + """ + + burst = Field(int) + qps = Field(int) + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a connection with the + webhook + """ + + caBundle = Field(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class Webhook(Model): + """ + Webhook holds the configuration of the webhook + """ + + clientConfig = RequiredField(WebhookClientConfig) + throttle = Field(WebhookThrottleConfig) + + +class Policy(Model): + """ + Policy defines the configuration of how audit events are logged + """ + + level = RequiredField(six.text_type) + stages = ListField(six.text_type) + + +class AuditSinkSpec(Model): + """ + AuditSinkSpec holds the spec for the audit sink + """ + + policy = RequiredField(Policy) + webhook = RequiredField(Webhook) + + +class AuditSink(Model): + """ + AuditSink represents a cluster level audit sink + """ + class Meta: + create_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks" + delete_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}" + get_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}" + list_all_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks" + update_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}" + watch_url = "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks/{name}" + watchlist_all_url = "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks" + + apiVersion = Field(six.text_type, "auditregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "AuditSink") + + metadata = Field(ObjectMeta) + spec = Field(AuditSinkSpec) + + +class AuditSinkList(Model): + """ + AuditSinkList is a list of AuditSink items. + """ + apiVersion = Field(six.text_type, "auditregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "AuditSinkList") + + items = ListField(AuditSink) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/authentication/__init__.py b/k8s/models/v1_13/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/authentication/v1.py b/k8s/models/v1_13/api/authentication/v1.py new file mode 100644 index 0000000..364da80 --- /dev/null +++ b/k8s/models/v1_13/api/authentication/v1.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + audiences = ListField(six.text_type) + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + audiences = ListField(six.text_type) + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_13/api/authentication/v1beta1.py b/k8s/models/v1_13/api/authentication/v1beta1.py new file mode 100644 index 0000000..1d1ee59 --- /dev/null +++ b/k8s/models/v1_13/api/authentication/v1beta1.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + audiences = ListField(six.text_type) + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + audiences = ListField(six.text_type) + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_13/api/authorization/__init__.py b/k8s/models/v1_13/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/authorization/v1.py b/k8s/models/v1_13/api/authorization/v1.py new file mode 100644 index 0000000..96d49dc --- /dev/null +++ b/k8s/models/v1_13/api/authorization/v1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_13/api/authorization/v1beta1.py b/k8s/models/v1_13/api/authorization/v1beta1.py new file mode 100644 index 0000000..f53bac4 --- /dev/null +++ b/k8s/models/v1_13/api/authorization/v1beta1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_13/api/autoscaling/__init__.py b/k8s/models/v1_13/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/autoscaling/v1.py b/k8s/models/v1_13/api/autoscaling/v1.py new file mode 100644 index 0000000..da5ceae --- /dev/null +++ b/k8s/models/v1_13/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/autoscaling/v2beta1.py b/k8s/models/v1_13/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..ed36d2f --- /dev/null +++ b/k8s/models/v1_13/api/autoscaling/v2beta1.py @@ -0,0 +1,234 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + currentAverageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). Exactly one 'target' type + should be set. + """ + + metricName = RequiredField(six.text_type) + metricSelector = Field(LabelSelector) + targetAverageValue = Field(six.text_type) + targetValue = Field(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + averageValue = Field(six.text_type) + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + averageValue = Field(six.text_type) + metricName = RequiredField(six.text_type) + selector = Field(LabelSelector) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/autoscaling/v2beta2.py b/k8s/models/v1_13/api/autoscaling/v2beta2.py new file mode 100644 index 0000000..9dbdb0f --- /dev/null +++ b/k8s/models/v1_13/api/autoscaling/v2beta2.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class MetricValueStatus(Model): + """ + MetricValueStatus holds the current value for a metric + """ + + averageUtilization = Field(int) + averageValue = Field(six.text_type) + value = Field(six.text_type) + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + current = RequiredField(MetricValueStatus) + name = RequiredField(six.text_type) + + +class MetricTarget(Model): + """ + MetricTarget defines the target value, average value, or average utilization of + a specific metric + """ + + averageUtilization = Field(int) + averageValue = Field(six.text_type) + type = RequiredField(six.text_type) + value = Field(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + target = RequiredField(MetricTarget) + + +class MetricIdentifier(Model): + """ + MetricIdentifier defines the name and optionally selector for a metric + """ + + name = RequiredField(six.text_type) + selector = Field(LabelSelector) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + current = RequiredField(MetricValueStatus) + metric = RequiredField(MetricIdentifier) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class ExternalMetricStatus(Model): + """ + ExternalMetricStatus indicates the current value of a global metric not + associated with any Kubernetes object. + """ + + current = RequiredField(MetricValueStatus) + metric = RequiredField(MetricIdentifier) + + +class ExternalMetricSource(Model): + """ + ExternalMetricSource indicates how to scale on a metric not associated with any + Kubernetes object (for example length of queue in cloud messaging service, or + QPS from loadbalancer running outside of cluster). + """ + + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + current = RequiredField(MetricValueStatus) + describedObject = RequiredField(CrossVersionObjectReference) + metric = RequiredField(MetricIdentifier) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + external = Field(ExternalMetricStatus) + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + describedObject = RequiredField(CrossVersionObjectReference) + metric = RequiredField(MetricIdentifier) + target = RequiredField(MetricTarget) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + external = Field(ExternalMetricSource) + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta2/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta2") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta2") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/batch/__init__.py b/k8s/models/v1_13/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/batch/v1.py b/k8s/models/v1_13/api/batch/v1.py new file mode 100644 index 0000000..eae1cf9 --- /dev/null +++ b/k8s/models/v1_13/api/batch/v1.py @@ -0,0 +1,96 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.core.v1 import PodTemplateSpec +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + ttlSecondsAfterFinished = Field(int) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/batch/v1beta1.py b/k8s/models/v1_13/api/batch/v1beta1.py new file mode 100644 index 0000000..22ebffb --- /dev/null +++ b/k8s/models/v1_13/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.batch.v1 import JobSpec +from k8s.models.v1_13.api.core.v1 import ObjectReference +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/batch/v2alpha1.py b/k8s/models/v1_13/api/batch/v2alpha1.py new file mode 100644 index 0000000..ab5f01d --- /dev/null +++ b/k8s/models/v1_13/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.batch.v1 import JobSpec +from k8s.models.v1_13.api.core.v1 import ObjectReference +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/certificates/__init__.py b/k8s/models/v1_13/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/certificates/v1beta1.py b/k8s/models/v1_13/api/certificates/v1beta1.py new file mode 100644 index 0000000..7d83ea5 --- /dev/null +++ b/k8s/models/v1_13/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/coordination/__init__.py b/k8s/models/v1_13/api/coordination/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/coordination/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/coordination/v1beta1.py b/k8s/models/v1_13/api/coordination/v1beta1.py new file mode 100644 index 0000000..aecabb5 --- /dev/null +++ b/k8s/models/v1_13/api/coordination/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class LeaseSpec(Model): + """ + LeaseSpec is a specification of a Lease. + """ + + acquireTime = Field(datetime.datetime) + holderIdentity = Field(six.text_type) + leaseDurationSeconds = Field(int) + leaseTransitions = Field(int) + renewTime = Field(datetime.datetime) + + +class Lease(Model): + """ + Lease defines a lease concept. + """ + class Meta: + create_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" + delete_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + get_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + list_all_url = "/apis/coordination.k8s.io/v1beta1/leases" + list_ns_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" + update_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" + watch_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases/{name}" + watchlist_all_url = "/apis/coordination.k8s.io/v1beta1/watch/leases" + watchlist_ns_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases" + + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") + kind = Field(six.text_type, "Lease") + + metadata = Field(ObjectMeta) + spec = Field(LeaseSpec) + + +class LeaseList(Model): + """ + LeaseList is a list of Lease objects. + """ + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") + kind = Field(six.text_type, "LeaseList") + + items = ListField(Lease) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/core/__init__.py b/k8s/models/v1_13/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/core/v1.py b/k8s/models/v1_13/api/core/v1.py new file mode 100644 index 0000000..2725330 --- /dev/null +++ b/k8s/models/v1_13/api/core/v1.py @@ -0,0 +1,2401 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class VolumeDevice(Model): + """ + volumeDevice describes a mapping of a raw block device within a container. + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class TypedLocalObjectReference(Model): + """ + TypedLocalObjectReference contains enough information to let you locate the + typed referenced object inside the same namespace. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + + +class TopologySelectorLabelRequirement(Model): + """ + A topology selector requirement is a selector that matches given label. This is + an alpha feature and may change in the future. + """ + + key = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class TopologySelectorTerm(Model): + """ + A topology selector term represents the result of label queries. A null or + empty topology selector term matches no objects. The requirements of them are + ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an + alpha feature and may change in the future. + """ + + matchLabelExpressions = ListField(TopologySelectorLabelRequirement) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class Sysctl(Model): + """ + Sysctl defines a kernel parameter to be set + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class ServiceAccountTokenProjection(Model): + """ + ServiceAccountTokenProjection represents a projected service account token + volume. This projection can be used to insert a service account token into the + pods runtime filesystem for use against APIs (Kubernetes API Server or + otherwise). + """ + + audience = Field(six.text_type) + expirationSeconds = Field(int) + path = RequiredField(six.text_type) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDPersistentVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class ISCSIPersistentVolumeSource(Model): + """ + ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be + mounted as read/write once. ISCSI volumes support ownership management and + SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + targetPortal = RequiredField(six.text_type) + + +class FlexPersistentVolumeSource(Model): + """ + FlexPersistentVolumeSource represents a generic persistent volume resource that + is provisioned/attached using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(SecretReference) + + +class CinderPersistentVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + volumeID = RequiredField(six.text_type) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class CSIPersistentVolumeSource(Model): + """ + Represents storage that is managed by an external CSI volume driver (Beta + feature) + """ + + controllerPublishSecretRef = Field(SecretReference) + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + nodePublishSecretRef = Field(SecretReference) + nodeStageSecretRef = Field(SecretReference) + readOnly = Field(bool) + volumeAttributes = Field(dict) + volumeHandle = RequiredField(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class ScopedResourceSelectorRequirement(Model): + """ + A scoped-resource selector requirement is a selector that contains values, a + scope name, and an operator that relates the scope name and values. + """ + + operator = RequiredField(six.text_type) + scopeName = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class ScopeSelector(Model): + """ + A scope selector represents the AND of the selectors represented by the scoped- + resource selector requirements. + """ + + matchExpressions = ListField(ScopedResourceSelectorRequirement) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopeSelector = Field(ScopeSelector) + scopes = ListField(six.text_type) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + sysctls = ListField(Sysctl) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + dataSource = Field(TypedLocalObjectReference) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeMode = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodReadinessGate(Model): + """ + PodReadinessGate contains the reference to a pod condition + """ + + conditionType = RequiredField(six.text_type) + + +class PodDNSConfigOption(Model): + """ + PodDNSConfigOption defines DNS resolver options of a pod. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class PodDNSConfig(Model): + """ + PodDNSConfig defines the DNS parameters of a pod in addition to those generated + from DNSPolicy. + """ + + nameservers = ListField(six.text_type) + options = ListField(PodDNSConfigOption) + searches = ListField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key matches that of any node on + which a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = RequiredField(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. The requirements of them + are ANDed. The TopologySelectorTerm type implements a subset of the + NodeSelectorTerm. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + matchFields = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class VolumeNodeAffinity(Model): + """ + VolumeNodeAffinity defines constraints that limit what nodes this volume can be + accessed from. + """ + + required = Field(NodeSelector) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity (Beta feature) + """ + + fsType = Field(six.text_type) + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeID = RequiredField(six.text_type) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + serviceAccountToken = Field(ServiceAccountTokenProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GlusterfsPersistentVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + endpointsNamespace = Field(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + + DEPRECATED: GitRepo is deprecated. To provision a + container with a git repo, mount an EmptyDir into an InitContainer that clones + the repo using git, then mount the EmptyDir into the Pod's container. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = Field(int) + lastObservedTime = Field(datetime.datetime) + state = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + count = Field(int) + eventTime = Field(datetime.datetime) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + related = Field(ObjectReference) + reportingComponent = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system, especially if the node that hosts the pod cannot + contact the control plane. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + nominatedNodeName = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapNodeConfigSource(Model): + """ + ConfigMapNodeConfigSource contains the information to reference a ConfigMap as + a config source for the Node. + """ + + kubeletConfigKey = RequiredField(six.text_type) + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + + configMap = Field(ConfigMapNodeConfigSource) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class NodeConfigStatus(Model): + """ + NodeConfigStatus describes the status of the config assigned by + Node.Spec.ConfigSource. + """ + + active = Field(NodeConfigSource) + assigned = Field(NodeConfigSource) + error = Field(six.text_type) + lastKnownGood = Field(NodeConfigSource) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + binaryData = Field(dict) + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + procMount = Field(six.text_type) + readOnlyRootFilesystem = Field(bool) + runAsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeDevices = ListField(VolumeDevice) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + config = Field(NodeConfigStatus) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsConfig = Field(PodDNSConfig) + dnsPolicy = Field(six.text_type) + enableServiceLinks = Field(bool) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + readinessGates = ListField(PodReadinessGate) + restartPolicy = Field(six.text_type) + runtimeClassName = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + shareProcessNamespace = Field(bool) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderPersistentVolumeSource) + claimRef = Field(ObjectReference) + csi = Field(CSIPersistentVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexPersistentVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsPersistentVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIPersistentVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + nodeAffinity = Field(VolumeNodeAffinity) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDPersistentVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + volumeMode = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/events/__init__.py b/k8s/models/v1_13/api/events/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/events/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/events/v1beta1.py b/k8s/models/v1_13/api/events/v1beta1.py new file mode 100644 index 0000000..6eeca68 --- /dev/null +++ b/k8s/models/v1_13/api/events/v1beta1.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.core.v1 import EventSource, ObjectReference +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continuously for some time. + """ + + count = RequiredField(int) + lastObservedTime = RequiredField(datetime.datetime) + state = RequiredField(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. It generally denotes + some state change in the system. + """ + class Meta: + create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + get_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + list_all_url = "/apis/events.k8s.io/v1beta1/events" + list_ns_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + update_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" + watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + deprecatedCount = Field(int) + deprecatedFirstTimestamp = Field(datetime.datetime) + deprecatedLastTimestamp = Field(datetime.datetime) + deprecatedSource = Field(EventSource) + eventTime = RequiredField(datetime.datetime) + metadata = Field(ObjectMeta) + note = Field(six.text_type) + reason = Field(six.text_type) + regarding = Field(ObjectReference) + related = Field(ObjectReference) + reportingController = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of Event objects. + """ + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/extensions/__init__.py b/k8s/models/v1_13/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/extensions/v1beta1.py b/k8s/models/v1_13/api/extensions/v1beta1.py new file mode 100644 index 0000000..a4a7d0f --- /dev/null +++ b/k8s/models/v1_13/api/extensions/v1beta1.py @@ -0,0 +1,709 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. Deprecated: use SELinuxStrategyOptions from policy API Group + instead. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by + networking/v1/NetworkPolicyPort. + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + DEPRECATED 1.9 - This group version of IPBlock is deprecated by + networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. + '192.168.1.1/24') that is allowed to the pods matched by a NetworkPolicySpec's + podSelector. The except entry describes CIDRs that should not be included + within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by + networking/v1/NetworkPolicyPeer. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated + by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule + matches traffic if and only if the traffic matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by + networking/v1/NetworkPolicyEgressRule. NetworkPolicyEgressRule describes a + particular set of traffic that is allowed out of pods matched by a + NetworkPolicySpec's podSelector. The traffic must match both ports and to. This + type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by + networking/v1/NetworkPolicySpec. + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by + networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is + allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by + networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy + objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. Deprecated: use IDRange + from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. Deprecated: use SupplementalGroupsStrategyOptions from + policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. Deprecated: use RunAsUserStrategyOptions from policy API + Group instead. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class RunAsGroupStrategyOptions(Model): + """ + RunAsGroupStrategyOptions defines the strategy type and any options used to + create the strategy. Deprecated: use RunAsGroupStrategyOptions from policy API + Group instead. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. Deprecated: use FSGroupStrategyOptions from policy API Group instead. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. Deprecated: + use HostPortRange from policy API Group instead. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. Deprecated: + use AllowedHostPath from policy API Group instead. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + Deprecated: use AllowedFlexVolume from policy API Group instead. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. Deprecated: use + PodSecurityPolicySpec from policy API Group instead. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedProcMountTypes = ListField(six.text_type) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsGroup = Field(RunAsGroupStrategyOptions) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. Deprecated: use + PodSecurityPolicy from policy API Group instead. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. Deprecated: use + PodSecurityPolicyList from policy API Group instead. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/networking/__init__.py b/k8s/models/v1_13/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/networking/v1.py b/k8s/models/v1_13/api/networking/v1.py new file mode 100644 index 0000000..9d8ec8a --- /dev/null +++ b/k8s/models/v1_13/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Only certain + combinations of fields are allowed + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/policy/__init__.py b/k8s/models/v1_13/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/policy/v1beta1.py b/k8s/models/v1_13/api/policy/v1beta1.py new file mode 100644 index 0000000..00d6531 --- /dev/null +++ b/k8s/models/v1_13/api/policy/v1beta1.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.core.v1 import SELinuxOptions +from k8s.models.v1_13.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SELinuxStrategyOptions(Model): + """ + SELinuxStrategyOptions defines the strategy type and any options used to create + the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = Field(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + IDRange provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + RunAsUserStrategyOptions defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class RunAsGroupStrategyOptions(Model): + """ + RunAsGroupStrategyOptions defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + HostPortRange defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + + +class AllowedHostPath(Model): + """ + AllowedHostPath defines the host volume conditions that will be enabled by a + policy for pods to use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + readOnly = Field(bool) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + PodSecurityPolicySpec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + allowedProcMountTypes = ListField(six.text_type) + allowedUnsafeSysctls = ListField(six.text_type) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + forbiddenSysctls = ListField(six.text_type) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsGroup = Field(RunAsGroupStrategyOptions) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + PodSecurityPolicy governs the ability to make requests that affect the Security + Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/policy/v1beta1/podsecuritypolicies" + delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/policy/v1beta1/podsecuritypolicies" + update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + PodSecurityPolicyList is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/rbac/__init__.py b/k8s/models/v1_13/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/rbac/v1.py b/k8s/models/v1_13/api/rbac/v1.py new file mode 100644 index 0000000..12069d2 --- /dev/null +++ b/k8s/models/v1_13/api/rbac/v1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/rbac/v1alpha1.py b/k8s/models/v1_13/api/rbac/v1alpha1.py new file mode 100644 index 0000000..9d7d41d --- /dev/null +++ b/k8s/models/v1_13/api/rbac/v1alpha1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/rbac/v1beta1.py b/k8s/models/v1_13/api/rbac/v1beta1.py new file mode 100644 index 0000000..7c1f668 --- /dev/null +++ b/k8s/models/v1_13/api/rbac/v1beta1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/scheduling/__init__.py b/k8s/models/v1_13/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/scheduling/v1alpha1.py b/k8s/models/v1_13/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..9f09cc4 --- /dev/null +++ b/k8s/models/v1_13/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/scheduling/v1beta1.py b/k8s/models/v1_13/api/scheduling/v1beta1.py new file mode 100644 index 0000000..d628313 --- /dev/null +++ b/k8s/models/v1_13/api/scheduling/v1beta1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/settings/__init__.py b/k8s/models/v1_13/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/settings/v1alpha1.py b/k8s/models/v1_13/api/settings/v1alpha1.py new file mode 100644 index 0000000..0858cd5 --- /dev/null +++ b/k8s/models/v1_13/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_13.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_13.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/storage/__init__.py b/k8s/models/v1_13/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/api/storage/v1.py b/k8s/models/v1_13/api/storage/v1.py new file mode 100644 index 0000000..f68d7cf --- /dev/null +++ b/k8s/models/v1_13/api/storage/v1.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/storage/v1alpha1.py b/k8s/models/v1_13/api/storage/v1alpha1.py new file mode 100644 index 0000000..ed4cda5 --- /dev/null +++ b/k8s/models/v1_13/api/storage/v1alpha1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/api/storage/v1beta1.py b/k8s/models/v1_13/api/storage/v1beta1.py new file mode 100644 index 0000000..89b55e4 --- /dev/null +++ b/k8s/models/v1_13/api/storage/v1beta1.py @@ -0,0 +1,138 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.api.core.v1 import TopologySelectorTerm +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + allowedTopologies = ListField(TopologySelectorTerm) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/apiextensions_apiserver/__init__.py b/k8s/models/v1_13/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_13/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..9bdc97f --- /dev/null +++ b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,203 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook. It has the same field as + admissionregistration.v1beta1.WebhookClientConfig. + """ + + caBundle = Field(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class CustomResourceConversion(Model): + """ + CustomResourceConversion describes how to convert different versions of a CR. + """ + + strategy = RequiredField(six.text_type) + webhookClientConfig = Field(WebhookClientConfig) + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + +class CustomResourceSubresourceScale(Model): + """ + CustomResourceSubresourceScale defines how to serve the scale subresource for + CustomResources. + """ + + labelSelectorPath = Field(six.text_type) + specReplicasPath = RequiredField(six.text_type) + statusReplicasPath = RequiredField(six.text_type) + + +class CustomResourceSubresources(Model): + """ + CustomResourceSubresources defines the status and scale subresources for + CustomResources. + """ + + scale = Field(CustomResourceSubresourceScale) + status = Field(dict) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + categories = ListField(six.text_type) + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + storedVersions = ListField(six.text_type) + + +class CustomResourceColumnDefinition(Model): + """ + CustomResourceColumnDefinition specifies a column for server side printing. + """ + + JSONPath = RequiredField(six.text_type) + description = Field(six.text_type) + format = Field(six.text_type) + name = RequiredField(six.text_type) + priority = Field(int) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionVersion(Model): + """ + CustomResourceDefinitionVersion describes a version for CRD. + """ + + additionalPrinterColumns = ListField(CustomResourceColumnDefinition) + name = RequiredField(six.text_type) + schema = Field(CustomResourceValidation) + served = RequiredField(bool) + storage = RequiredField(bool) + subresources = Field(CustomResourceSubresources) + + +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + additionalPrinterColumns = ListField(CustomResourceColumnDefinition) + conversion = Field(CustomResourceConversion) + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + subresources = Field(CustomResourceSubresources) + validation = Field(CustomResourceValidation) + version = Field(six.text_type) + versions = ListField(CustomResourceDefinitionVersion) + + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = RequiredField(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/apimachinery/__init__.py b/k8s/models/v1_13/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apimachinery/apis/__init__.py b/k8s/models/v1_13/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apimachinery/apis/meta/__init__.py b/k8s/models/v1_13/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/apimachinery/apis/meta/v1.py b/k8s/models/v1_13/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..f6e0899 --- /dev/null +++ b/k8s/models/v1_13/apimachinery/apis/meta/v1.py @@ -0,0 +1,269 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_13.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + dryRun = ListField(six.text_type) + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. An owning object must be in the same namespace as the dependent, or be + cluster-scoped, so there is no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_13/apimachinery/runtime.py b/k8s/models/v1_13/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_13/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_13/apimachinery/version.py b/k8s/models/v1_13/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_13/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_13/kube_aggregator/__init__.py b/k8s/models/v1_13/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/kube_aggregator/apis/__init__.py b/k8s/models/v1_13/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py new file mode 100644 index 0000000..0d72282 --- /dev/null +++ b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..91f764b --- /dev/null +++ b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_13.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = Field(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/__init__.py b/k8s/models/v1_9/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/__init__.py b/k8s/models/v1_9/api/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/admissionregistration/__init__.py b/k8s/models/v1_9/api/admissionregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/admissionregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/admissionregistration/v1alpha1.py b/k8s/models/v1_9/api/admissionregistration/v1alpha1.py new file mode 100644 index 0000000..1dc2bed --- /dev/null +++ b/k8s/models/v1_9/api/admissionregistration/v1alpha1.py @@ -0,0 +1,70 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Rule(Model): + """ + Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Initializer(Model): + """ + Initializer describes the name and the failure policy of an initializer, and + what resources it applies to. + """ + + name = RequiredField(six.text_type) + rules = ListField(Rule) + + +class InitializerConfiguration(Model): + """ + InitializerConfiguration describes the configuration of initializers. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfiguration") + + initializers = ListField(Initializer) + metadata = Field(ObjectMeta) + + +class InitializerConfigurationList(Model): + """ + InitializerConfigurationList is a list of InitializerConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") + kind = Field(six.text_type, "InitializerConfigurationList") + + items = ListField(InitializerConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/admissionregistration/v1beta1.py b/k8s/models/v1_9/api/admissionregistration/v1beta1.py new file mode 100644 index 0000000..288b27b --- /dev/null +++ b/k8s/models/v1_9/api/admissionregistration/v1beta1.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = RequiredField(six.text_type) + namespace = RequiredField(six.text_type) + path = Field(six.text_type) + + +class WebhookClientConfig(Model): + """ + WebhookClientConfig contains the information to make a TLS connection with the + webhook + """ + + caBundle = RequiredField(six.text_type) + service = Field(ServiceReference) + url = Field(six.text_type) + + +class RuleWithOperations(Model): + """ + RuleWithOperations is a tuple of Operations and Resources. It is recommended to + make sure that all the tuple expansions are valid. + """ + + apiGroups = ListField(six.text_type) + apiVersions = ListField(six.text_type) + operations = ListField(six.text_type) + resources = ListField(six.text_type) + + +class Webhook(Model): + """ + Webhook describes an admission webhook and the resources and operations it + applies to. + """ + + clientConfig = RequiredField(WebhookClientConfig) + failurePolicy = Field(six.text_type) + name = RequiredField(six.text_type) + namespaceSelector = Field(LabelSelector) + rules = ListField(RuleWithOperations) + + +class ValidatingWebhookConfiguration(Model): + """ + ValidatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and object without changing it. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class ValidatingWebhookConfigurationList(Model): + """ + ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "ValidatingWebhookConfigurationList") + + items = ListField(ValidatingWebhookConfiguration) + metadata = Field(ListMeta) + + +class MutatingWebhookConfiguration(Model): + """ + MutatingWebhookConfiguration describes the configuration of and admission + webhook that accept or reject and may change the object. + """ + class Meta: + create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + get_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + list_all_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" + update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" + watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" + watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" + + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfiguration") + + metadata = Field(ObjectMeta) + webhooks = ListField(Webhook) + + +class MutatingWebhookConfigurationList(Model): + """ + MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration. + """ + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "MutatingWebhookConfigurationList") + + items = ListField(MutatingWebhookConfiguration) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/apps/__init__.py b/k8s/models/v1_9/api/apps/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/apps/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/apps/v1.py b/k8s/models/v1_9/api/apps/v1.py new file mode 100644 index 0000000..04c17b6 --- /dev/null +++ b/k8s/models/v1_9/api/apps/v1.py @@ -0,0 +1,427 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_9.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1/statefulsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + ReplicaSet ensures that a specified number of pod replicas are running at any + given time. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1/replicasets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + Deployment enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1/deployments" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DaemonSet represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1/daemonsets" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1/controllerrevisions" + list_ns_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/apps/v1beta1.py b/k8s/models/v1_9/api/apps/v1beta1.py new file mode 100644 index 0000000..89d388d --- /dev/null +++ b/k8s/models/v1_9/api/apps/v1beta1.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_9.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1beta2/StatefulSet. See the release notes for more information. + StatefulSet represents a set of pods with consistent identities. Identities are + defined as: + - Network: A single stable DNS and hostname. + - Storage: As many + VolumeClaims as requested. + The StatefulSet guarantees that a given network + identity will always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta1/statefulsets" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta1/deployments" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1beta2/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta1/controllerrevisions" + list_ns_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta1") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/apps/v1beta2.py b/k8s/models/v1_9/api/apps/v1beta2.py new file mode 100644 index 0000000..9179c7f --- /dev/null +++ b/k8s/models/v1_9/api/apps/v1beta2.py @@ -0,0 +1,465 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.api.core.v1 import PersistentVolumeClaim, PodTemplateSpec +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta +from k8s.models.v1_9.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StatefulSetCondition(Model): + """ + StatefulSetCondition describes the state of a statefulset at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class StatefulSetStatus(Model): + """ + StatefulSetStatus represents the current state of a StatefulSet. + """ + + collisionCount = Field(int) + conditions = ListField(StatefulSetCondition) + currentReplicas = Field(int) + currentRevision = Field(six.text_type) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + updateRevision = Field(six.text_type) + updatedReplicas = Field(int) + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class RollingUpdateStatefulSetStrategy(Model): + """ + RollingUpdateStatefulSetStrategy is used to communicate parameter for + RollingUpdateStatefulSetStrategyType. + """ + + partition = Field(int) + + +class StatefulSetUpdateStrategy(Model): + """ + StatefulSetUpdateStrategy indicates the strategy that the StatefulSet + controller will use to perform updates. It includes any additional parameters + necessary to perform the update for the indicated strategy. + """ + + rollingUpdate = Field(RollingUpdateStatefulSetStrategy) + type = Field(six.text_type) + + +class StatefulSetSpec(Model): + """ + A StatefulSetSpec is the specification of a StatefulSet. + """ + + podManagementPolicy = Field(six.text_type) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + serviceName = RequiredField(six.text_type) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(StatefulSetUpdateStrategy) + volumeClaimTemplates = ListField(PersistentVolumeClaim) + + +class StatefulSet(Model): + """ + DEPRECATED - This group version of StatefulSet is deprecated by + apps/v1/StatefulSet. See the release notes for more information. StatefulSet + represents a set of pods with consistent identities. Identities are defined as: + - Network: A single stable DNS and hostname. + - Storage: As many VolumeClaims + as requested. + The StatefulSet guarantees that a given network identity will + always map to the same storage identity. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + list_all_url = "/apis/apps/v1beta2/statefulsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSet") + + metadata = Field(ObjectMeta) + spec = Field(StatefulSetSpec) + status = Field(StatefulSetStatus) + + +class StatefulSetList(Model): + """ + StatefulSetList is a collection of StatefulSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "StatefulSetList") + + items = ListField(StatefulSet) + metadata = Field(ListMeta) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + DaemonSetUpdateStrategy is a struct used to control the update strategy for a + DaemonSet. + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = RequiredField(LabelSelector) + template = RequiredField(PodTemplateSpec) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = RequiredField(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/apps/v1beta2/replicasets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/apps/v1beta2/deployments" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/apps/v1beta2/daemonsets" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class ControllerRevision(Model): + """ + DEPRECATED - This group version of ControllerRevision is deprecated by + apps/v1/ControllerRevision. See the release notes for more information. + ControllerRevision implements an immutable snapshot of state data. Clients are + responsible for serializing and deserializing the objects that contain their + internal state. Once a ControllerRevision has been successfully created, it can + not be updated. The API Server will fail validation of all requests that + attempt to mutate the Data field. ControllerRevisions may, however, be deleted. + Note that, due to its use by both the DaemonSet and StatefulSet controllers for + update and rollback, this object is beta. However, it may be subject to name + and representation changes in future releases, and clients should not depend on + its stability. It is primarily for internal use by controllers. + """ + class Meta: + create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + get_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + list_all_url = "/apis/apps/v1beta2/controllerrevisions" + list_ns_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" + update_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" + watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" + watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" + watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" + + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevision") + + data = Field(RawExtension) + metadata = Field(ObjectMeta) + revision = RequiredField(int) + + +class ControllerRevisionList(Model): + """ + ControllerRevisionList is a resource containing a list of ControllerRevision + objects. + """ + apiVersion = Field(six.text_type, "apps/v1beta2") + kind = Field(six.text_type, "ControllerRevisionList") + + items = ListField(ControllerRevision) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/authentication/__init__.py b/k8s/models/v1_9/api/authentication/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/authentication/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/authentication/v1.py b/k8s/models/v1_9/api/authentication/v1.py new file mode 100644 index 0000000..ca9a706 --- /dev/null +++ b/k8s/models/v1_9/api/authentication/v1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_9/api/authentication/v1beta1.py b/k8s/models/v1_9/api/authentication/v1beta1.py new file mode 100644 index 0000000..b4224cf --- /dev/null +++ b/k8s/models/v1_9/api/authentication/v1beta1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class UserInfo(Model): + """ + UserInfo holds the information about the user needed to implement the user.Info + interface. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + uid = Field(six.text_type) + username = Field(six.text_type) + + +class TokenReviewStatus(Model): + """ + TokenReviewStatus is the result of the token authentication request. + """ + + authenticated = Field(bool) + error = Field(six.text_type) + user = Field(UserInfo) + + +class TokenReviewSpec(Model): + """ + TokenReviewSpec is a description of the token authentication request. + """ + + token = Field(six.text_type) + + +class TokenReview(Model): + """ + TokenReview attempts to authenticate a token to a known user. Note: TokenReview + requests may be cached by the webhook token authenticator plugin in the kube- + apiserver. + """ + class Meta: + create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" + + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") + kind = Field(six.text_type, "TokenReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(TokenReviewSpec) + status = Field(TokenReviewStatus) + diff --git a/k8s/models/v1_9/api/authorization/__init__.py b/k8s/models/v1_9/api/authorization/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/authorization/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/authorization/v1.py b/k8s/models/v1_9/api/authorization/v1.py new file mode 100644 index 0000000..9de1e79 --- /dev/null +++ b/k8s/models/v1_9/api/authorization/v1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + groups = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_9/api/authorization/v1beta1.py b/k8s/models/v1_9/api/authorization/v1beta1.py new file mode 100644 index 0000000..9cef49d --- /dev/null +++ b/k8s/models/v1_9/api/authorization/v1beta1.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class SubjectAccessReviewStatus(Model): + """ + SubjectAccessReviewStatus + """ + + allowed = RequiredField(bool) + denied = Field(bool) + evaluationError = Field(six.text_type) + reason = Field(six.text_type) + + +class SelfSubjectRulesReviewSpec(Model): + """ + + """ + + namespace = Field(six.text_type) + + +class ResourceRule(Model): + """ + ResourceRule is the list of actions the subject is allowed to perform on + resources. The list ordering isn't significant, may contain duplicates, and + possibly be incomplete. + """ + + apiGroups = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class ResourceAttributes(Model): + """ + ResourceAttributes includes the authorization attributes available for resource + requests to the Authorizer interface + """ + + group = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resource = Field(six.text_type) + subresource = Field(six.text_type) + verb = Field(six.text_type) + version = Field(six.text_type) + + +class NonResourceRule(Model): + """ + NonResourceRule holds information that describes a rule for the non-resource + """ + + nonResourceURLs = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class SubjectRulesReviewStatus(Model): + """ + SubjectRulesReviewStatus contains the result of a rules check. This check can + be incomplete depending on the set of authorizers the server is configured with + and any errors experienced during evaluation. Because authorization rules are + additive, if a rule appears in a list it's safe to assume the subject has that + permission, even if that list is incomplete. + """ + + evaluationError = Field(six.text_type) + incomplete = RequiredField(bool) + nonResourceRules = ListField(NonResourceRule) + resourceRules = ListField(ResourceRule) + + +class SelfSubjectRulesReview(Model): + """ + SelfSubjectRulesReview enumerates the set of actions the current user can + perform within a namespace. The returned list of actions may be incomplete + depending on the server's authorization mode, and any errors experienced during + the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide + actions, or to quickly let an end user reason about their permissions. It + should NOT Be used by external systems to drive authorization decisions as this + raises confused deputy, cache lifetime/revocation, and correctness concerns. + SubjectAccessReview, and LocalAccessReview are the correct way to defer + authorization decisions to the API server. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectRulesReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectRulesReviewSpec) + status = Field(SubjectRulesReviewStatus) + + +class NonResourceAttributes(Model): + """ + NonResourceAttributes includes the authorization attributes available for non- + resource requests to the Authorizer interface + """ + + path = Field(six.text_type) + verb = Field(six.text_type) + + +class SubjectAccessReviewSpec(Model): + """ + SubjectAccessReviewSpec is a description of the access request. Exactly one of + ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be + set + """ + + extra = Field(dict) + group = ListField(six.text_type) + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + uid = Field(six.text_type) + user = Field(six.text_type) + + +class SubjectAccessReview(Model): + """ + SubjectAccessReview checks whether or not a user or group can perform an + action. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class LocalSubjectAccessReview(Model): + """ + LocalSubjectAccessReview checks whether or not a user or group can perform an + action in a given namespace. Having a namespace scoped resource makes it much + easier to grant namespace scoped policy that includes permissions checking. + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "LocalSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + + +class SelfSubjectAccessReviewSpec(Model): + """ + SelfSubjectAccessReviewSpec is a description of the access request. Exactly + one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes + must be set + """ + + nonResourceAttributes = Field(NonResourceAttributes) + resourceAttributes = Field(ResourceAttributes) + + +class SelfSubjectAccessReview(Model): + """ + SelfSubjectAccessReview checks whether or the current user can perform an + action. Not filling in a spec.namespace means 'in all namespaces'. Self is a + special case, because users should always be able to check whether they can + perform an action + """ + class Meta: + create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" + + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "SelfSubjectAccessReview") + + metadata = Field(ObjectMeta) + spec = RequiredField(SelfSubjectAccessReviewSpec) + status = Field(SubjectAccessReviewStatus) + diff --git a/k8s/models/v1_9/api/autoscaling/__init__.py b/k8s/models/v1_9/api/autoscaling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/autoscaling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/autoscaling/v1.py b/k8s/models/v1_9/api/autoscaling/v1.py new file mode 100644 index 0000000..86e4adf --- /dev/null +++ b/k8s/models/v1_9/api/autoscaling/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + ScaleStatus represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + ScaleSpec describes the attributes of a scale subresource. + """ + + replicas = Field(int) + + +class Scale(Model): + """ + Scale represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class HorizontalPodAutoscalerStatus(Model): + """ + current status of a horizontal pod autoscaler + """ + + currentCPUUtilizationPercentage = Field(int) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + specification of a horizontal pod autoscaler. + """ + + maxReplicas = RequiredField(int) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + targetCPUUtilizationPercentage = Field(int) + + +class HorizontalPodAutoscaler(Model): + """ + configuration of a horizontal pod autoscaler. + """ + class Meta: + create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/autoscaling/v2beta1.py b/k8s/models/v1_9/api/autoscaling/v2beta1.py new file mode 100644 index 0000000..c10c8a4 --- /dev/null +++ b/k8s/models/v1_9/api/autoscaling/v2beta1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ResourceMetricStatus(Model): + """ + ResourceMetricStatus indicates the current value of a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. + """ + + currentAverageUtilization = Field(int) + currentAverageValue = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class ResourceMetricSource(Model): + """ + ResourceMetricSource indicates how to scale on a resource metric known to + Kubernetes, as specified in requests and limits, describing each pod in the + current scale target (e.g. CPU or memory). The values will be averaged + together before being compared to the target. Such metrics are built in to + Kubernetes, and have special scaling options on top of those available to + normal per-pod metrics using the 'pods' source. Only one 'target' type should + be set. + """ + + name = RequiredField(six.text_type) + targetAverageUtilization = Field(int) + targetAverageValue = Field(six.text_type) + + +class PodsMetricStatus(Model): + """ + PodsMetricStatus indicates the current value of a metric describing each pod in + the current scale target (for example, transactions-processed-per-second). + """ + + currentAverageValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + + +class PodsMetricSource(Model): + """ + PodsMetricSource indicates how to scale on a metric describing each pod in the + current scale target (for example, transactions-processed-per-second). The + values will be averaged together before being compared to the target value. + """ + + metricName = RequiredField(six.text_type) + targetAverageValue = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerCondition(Model): + """ + HorizontalPodAutoscalerCondition describes the state of a + HorizontalPodAutoscaler at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CrossVersionObjectReference(Model): + """ + CrossVersionObjectReference contains enough information to let you identify the + referred resource. + """ + + name = RequiredField(six.text_type) + + +class ObjectMetricStatus(Model): + """ + ObjectMetricStatus indicates the current value of a metric describing a + kubernetes object (for example, hits-per-second on an Ingress object). + """ + + currentValue = RequiredField(six.text_type) + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + + +class MetricStatus(Model): + """ + MetricStatus describes the last-read state of a single metric. + """ + + object = Field(ObjectMetricStatus) + pods = Field(PodsMetricStatus) + resource = Field(ResourceMetricStatus) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerStatus(Model): + """ + HorizontalPodAutoscalerStatus describes the current status of a horizontal pod + autoscaler. + """ + + conditions = ListField(HorizontalPodAutoscalerCondition) + currentMetrics = ListField(MetricStatus) + currentReplicas = RequiredField(int) + desiredReplicas = RequiredField(int) + lastScaleTime = Field(datetime.datetime) + observedGeneration = Field(int) + + +class ObjectMetricSource(Model): + """ + ObjectMetricSource indicates how to scale on a metric describing a kubernetes + object (for example, hits-per-second on an Ingress object). + """ + + metricName = RequiredField(six.text_type) + target = RequiredField(CrossVersionObjectReference) + targetValue = RequiredField(six.text_type) + + +class MetricSpec(Model): + """ + MetricSpec specifies how to scale based on a single metric (only `type` and one + other matching field should be set at once). + """ + + object = Field(ObjectMetricSource) + pods = Field(PodsMetricSource) + resource = Field(ResourceMetricSource) + type = RequiredField(six.text_type) + + +class HorizontalPodAutoscalerSpec(Model): + """ + HorizontalPodAutoscalerSpec describes the desired functionality of the + HorizontalPodAutoscaler. + """ + + maxReplicas = RequiredField(int) + metrics = ListField(MetricSpec) + minReplicas = Field(int) + scaleTargetRef = RequiredField(CrossVersionObjectReference) + + +class HorizontalPodAutoscaler(Model): + """ + HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, + which automatically manages the replica count of any resource implementing the + scale subresource based on the metrics specified. + """ + class Meta: + create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + get_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + list_all_url = "/apis/autoscaling/v2beta1/horizontalpodautoscalers" + list_ns_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" + update_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" + watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" + watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" + + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscaler") + + metadata = Field(ObjectMeta) + spec = Field(HorizontalPodAutoscalerSpec) + status = Field(HorizontalPodAutoscalerStatus) + + +class HorizontalPodAutoscalerList(Model): + """ + HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects. + """ + apiVersion = Field(six.text_type, "autoscaling/v2beta1") + kind = Field(six.text_type, "HorizontalPodAutoscalerList") + + items = ListField(HorizontalPodAutoscaler) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/batch/__init__.py b/k8s/models/v1_9/api/batch/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/batch/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/batch/v1.py b/k8s/models/v1_9/api/batch/v1.py new file mode 100644 index 0000000..b9a6f07 --- /dev/null +++ b/k8s/models/v1_9/api/batch/v1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.api.core.v1 import PodTemplateSpec +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobSpec(Model): + """ + JobSpec describes how the job execution will look like. + """ + + activeDeadlineSeconds = Field(int) + backoffLimit = Field(int) + completions = Field(int) + manualSelector = Field(bool) + parallelism = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + + +class JobCondition(Model): + """ + JobCondition describes current state of a job. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class JobStatus(Model): + """ + JobStatus represents the current state of a Job. + """ + + active = Field(int) + completionTime = Field(datetime.datetime) + conditions = ListField(JobCondition) + failed = Field(int) + startTime = Field(datetime.datetime) + succeeded = Field(int) + + +class Job(Model): + """ + Job represents the configuration of a single job. + """ + class Meta: + create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + get_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + list_all_url = "/apis/batch/v1/jobs" + list_ns_url = "/apis/batch/v1/namespaces/{namespace}/jobs" + update_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" + watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" + watchlist_all_url = "/apis/batch/v1/watch/jobs" + watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" + + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "Job") + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + status = Field(JobStatus) + + +class JobList(Model): + """ + JobList is a collection of jobs. + """ + apiVersion = Field(six.text_type, "batch/v1") + kind = Field(six.text_type, "JobList") + + items = ListField(Job) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/batch/v1beta1.py b/k8s/models/v1_9/api/batch/v1beta1.py new file mode 100644 index 0000000..a100e59 --- /dev/null +++ b/k8s/models/v1_9/api/batch/v1beta1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.api.batch.v1 import JobSpec +from k8s.models.v1_9.api.core.v1 import ObjectReference +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v1beta1/cronjobs" + list_ns_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v1beta1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/batch/v2alpha1.py b/k8s/models/v1_9/api/batch/v2alpha1.py new file mode 100644 index 0000000..5b2b78c --- /dev/null +++ b/k8s/models/v1_9/api/batch/v2alpha1.py @@ -0,0 +1,90 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.api.batch.v1 import JobSpec +from k8s.models.v1_9.api.core.v1 import ObjectReference +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class JobTemplateSpec(Model): + """ + JobTemplateSpec describes the data a Job should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(JobSpec) + + +class CronJobSpec(Model): + """ + CronJobSpec describes how the job execution will look like and when it will + actually run. + """ + + concurrencyPolicy = Field(six.text_type) + failedJobsHistoryLimit = Field(int) + jobTemplate = RequiredField(JobTemplateSpec) + schedule = RequiredField(six.text_type) + startingDeadlineSeconds = Field(int) + successfulJobsHistoryLimit = Field(int) + suspend = Field(bool) + + +class CronJobStatus(Model): + """ + CronJobStatus represents the current state of a cron job. + """ + + active = ListField(ObjectReference) + lastScheduleTime = Field(datetime.datetime) + + +class CronJob(Model): + """ + CronJob represents the configuration of a single cron job. + """ + class Meta: + create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + get_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + list_all_url = "/apis/batch/v2alpha1/cronjobs" + list_ns_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" + update_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" + watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" + watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" + watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" + + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJob") + + metadata = Field(ObjectMeta) + spec = Field(CronJobSpec) + status = Field(CronJobStatus) + + +class CronJobList(Model): + """ + CronJobList is a collection of cron jobs. + """ + apiVersion = Field(six.text_type, "batch/v2alpha1") + kind = Field(six.text_type, "CronJobList") + + items = ListField(CronJob) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/certificates/__init__.py b/k8s/models/v1_9/api/certificates/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/certificates/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/certificates/v1beta1.py b/k8s/models/v1_9/api/certificates/v1beta1.py new file mode 100644 index 0000000..7c7f861 --- /dev/null +++ b/k8s/models/v1_9/api/certificates/v1beta1.py @@ -0,0 +1,87 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class CertificateSigningRequestSpec(Model): + """ + This information is immutable after the request is created. Only the Request + and Usages fields can be set on creation, other fields are derived by + Kubernetes and cannot be modified by users. + """ + + extra = Field(dict) + groups = ListField(six.text_type) + request = RequiredField(six.text_type) + uid = Field(six.text_type) + usages = ListField(six.text_type) + username = Field(six.text_type) + + +class CertificateSigningRequestCondition(Model): + """ + + """ + + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + type = RequiredField(six.text_type) + + +class CertificateSigningRequestStatus(Model): + """ + + """ + + certificate = Field(six.text_type) + conditions = ListField(CertificateSigningRequestCondition) + + +class CertificateSigningRequest(Model): + """ + Describes a certificate signing request + """ + class Meta: + create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + get_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + list_all_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" + update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" + watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" + watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" + + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequest") + + metadata = Field(ObjectMeta) + spec = Field(CertificateSigningRequestSpec) + status = Field(CertificateSigningRequestStatus) + + +class CertificateSigningRequestList(Model): + """ + + """ + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") + kind = Field(six.text_type, "CertificateSigningRequestList") + + items = ListField(CertificateSigningRequest) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/core/__init__.py b/k8s/models/v1_9/api/core/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/core/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/core/v1.py b/k8s/models/v1_9/api/core/v1.py new file mode 100644 index 0000000..504c40b --- /dev/null +++ b/k8s/models/v1_9/api/core/v1.py @@ -0,0 +1,2218 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VsphereVirtualDiskVolumeSource(Model): + """ + Represents a vSphere volume resource. + """ + + fsType = Field(six.text_type) + storagePolicyID = Field(six.text_type) + storagePolicyName = Field(six.text_type) + volumePath = RequiredField(six.text_type) + + +class VolumeMount(Model): + """ + VolumeMount describes a mounting of a Volume within a container. + """ + + mountPath = RequiredField(six.text_type) + mountPropagation = Field(six.text_type) + name = RequiredField(six.text_type) + readOnly = Field(bool) + subPath = Field(six.text_type) + + +class VolumeDevice(Model): + """ + volumeDevice describes a mapping of a raw block device within a container. + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class Toleration(Model): + """ + The pod this Toleration is attached to tolerates any taint that matches the + triple using the matching operator . + """ + + effect = Field(six.text_type) + key = Field(six.text_type) + operator = Field(six.text_type) + tolerationSeconds = Field(int) + value = Field(six.text_type) + + +class Taint(Model): + """ + The node this Taint is attached to has the 'effect' on any pod that does not + tolerate the Taint. + """ + + effect = RequiredField(six.text_type) + key = RequiredField(six.text_type) + timeAdded = Field(datetime.datetime) + value = Field(six.text_type) + + +class TCPSocketAction(Model): + """ + TCPSocketAction describes an action based on opening a socket + """ + + host = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + + +class ServicePort(Model): + """ + ServicePort contains information on service's port. + """ + + name = Field(six.text_type) + nodePort = Field(int) + port = RequiredField(int) + protocol = Field(six.text_type) + targetPort = Field(six.text_type, alt_type=int) + + +class SecretReference(Model): + """ + SecretReference represents a Secret Reference. It has enough information to + retrieve secret in any namespace + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class ScaleIOPersistentVolumeSource(Model): + """ + ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(SecretReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDPersistentVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class ISCSIPersistentVolumeSource(Model): + """ + ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be + mounted as read/write once. ISCSI volumes support ownership management and + SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(SecretReference) + targetPortal = RequiredField(six.text_type) + + +class CephFSPersistentVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(SecretReference) + user = Field(six.text_type) + + +class SecretKeySelector(Model): + """ + SecretKeySelector selects a key of a Secret. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class SecretEnvSource(Model): + """ + SecretEnvSource selects a Secret to populate the environment variables with. + The contents of the target Secret's Data field will represent the key-value + pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class Secret(Model): + """ + Secret holds secret data of a certain type. The total bytes of the values in + the Data field must be less than MaxSecretSize bytes. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/secrets" + delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + get_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + list_all_url = "/api/v1/secrets" + list_ns_url = "/api/v1/namespaces/{namespace}/secrets" + update_url = "/api/v1/namespaces/{namespace}/secrets/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" + watchlist_all_url = "/api/v1/watch/secrets" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Secret") + + data = Field(dict) + metadata = Field(ObjectMeta) + stringData = Field(dict) + type = Field(six.text_type) + + +class SecretList(Model): + """ + SecretList is a list of Secret. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "SecretList") + + items = ListField(Secret) + metadata = Field(ListMeta) + + +class SELinuxOptions(Model): + """ + SELinuxOptions are the labels to be applied to the container + """ + + level = Field(six.text_type) + role = Field(six.text_type) + type = Field(six.text_type) + user = Field(six.text_type) + + +class PodSecurityContext(Model): + """ + PodSecurityContext holds pod-level security attributes and common container + settings. Some fields are also present in container.securityContext. Field + values of container.securityContext take precedence over field values of + PodSecurityContext. + """ + + fsGroup = Field(int) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + supplementalGroups = ListField(int) + + +class ResourceRequirements(Model): + """ + ResourceRequirements describes the compute resource requirements. + """ + + limits = Field(dict) + requests = Field(dict) + + +class PersistentVolumeClaimSpec(Model): + """ + PersistentVolumeClaimSpec describes the common attributes of storage devices + and allows a Source for provider-specific attributes + """ + + accessModes = ListField(six.text_type) + resources = Field(ResourceRequirements) + selector = Field(LabelSelector) + storageClassName = Field(six.text_type) + volumeMode = Field(six.text_type) + volumeName = Field(six.text_type) + + +class ResourceQuotaStatus(Model): + """ + ResourceQuotaStatus defines the enforced hard limits and observed use. + """ + + hard = Field(dict) + used = Field(dict) + + +class ResourceQuotaSpec(Model): + """ + ResourceQuotaSpec defines the desired hard limits to enforce for Quota. + """ + + hard = Field(dict) + scopes = ListField(six.text_type) + + +class ResourceQuota(Model): + """ + ResourceQuota sets aggregate quota restrictions enforced per namespace + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/resourcequotas" + delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + get_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + list_all_url = "/api/v1/resourcequotas" + list_ns_url = "/api/v1/namespaces/{namespace}/resourcequotas" + update_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" + watchlist_all_url = "/api/v1/watch/resourcequotas" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuota") + + metadata = Field(ObjectMeta) + spec = Field(ResourceQuotaSpec) + status = Field(ResourceQuotaStatus) + + +class ResourceQuotaList(Model): + """ + ResourceQuotaList is a list of ResourceQuota items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ResourceQuotaList") + + items = ListField(ResourceQuota) + metadata = Field(ListMeta) + + +class ResourceFieldSelector(Model): + """ + ResourceFieldSelector represents container resources (cpu, memory) and their + output format + """ + + containerName = Field(six.text_type) + divisor = Field(six.text_type) + resource = RequiredField(six.text_type) + + +class ReplicationControllerCondition(Model): + """ + ReplicationControllerCondition describes the state of a replication controller + at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicationControllerStatus(Model): + """ + ReplicationControllerStatus represents the current status of a replication + controller. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicationControllerCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class QuobyteVolumeSource(Model): + """ + Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do + not support ownership management or SELinux relabeling. + """ + + group = Field(six.text_type) + readOnly = Field(bool) + registry = RequiredField(six.text_type) + user = Field(six.text_type) + volume = RequiredField(six.text_type) + + +class PortworxVolumeSource(Model): + """ + PortworxVolumeSource represents a Portworx volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class PodDNSConfigOption(Model): + """ + PodDNSConfigOption defines DNS resolver options of a pod. + """ + + name = Field(six.text_type) + value = Field(six.text_type) + + +class PodDNSConfig(Model): + """ + PodDNSConfig defines the DNS parameters of a pod in addition to those generated + from DNSPolicy. + """ + + nameservers = ListField(six.text_type) + options = ListField(PodDNSConfigOption) + searches = ListField(six.text_type) + + +class PodCondition(Model): + """ + PodCondition contains details for the current condition of this pod. + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PodAffinityTerm(Model): + """ + Defines a set of pods (namely those matching the labelSelector relative to the + given namespace(s)) that this pod should be co-located (affinity) or not co- + located (anti-affinity) with, where co-located is defined as running on a node + whose value of the label with key matches that of any node on + which a pod of the set of pods is running + """ + + labelSelector = Field(LabelSelector) + namespaces = ListField(six.text_type) + topologyKey = RequiredField(six.text_type) + + +class WeightedPodAffinityTerm(Model): + """ + The weights of all of the matched WeightedPodAffinityTerm fields are added per- + node to find the most preferred node(s) + """ + + podAffinityTerm = RequiredField(PodAffinityTerm) + weight = RequiredField(int) + + +class PodAntiAffinity(Model): + """ + Pod anti affinity is a group of inter pod anti affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PodAffinity(Model): + """ + Pod affinity is a group of inter pod affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(WeightedPodAffinityTerm) + requiredDuringSchedulingIgnoredDuringExecution = ListField(PodAffinityTerm) + + +class PhotonPersistentDiskVolumeSource(Model): + """ + Represents a Photon Controller persistent disk resource. + """ + + fsType = Field(six.text_type) + pdID = RequiredField(six.text_type) + + +class PersistentVolumeStatus(Model): + """ + PersistentVolumeStatus is the current status of a persistent volume. + """ + + message = Field(six.text_type) + phase = Field(six.text_type) + reason = Field(six.text_type) + + +class PersistentVolumeClaimVolumeSource(Model): + """ + PersistentVolumeClaimVolumeSource references the user's PVC in the same + namespace. This volume finds the bound PV and mounts that volume for the pod. A + PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another + type of volume that is owned by someone else (the system). + """ + + claimName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class PersistentVolumeClaimCondition(Model): + """ + PersistentVolumeClaimCondition contails details about state of pvc + """ + + lastProbeTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class PersistentVolumeClaimStatus(Model): + """ + PersistentVolumeClaimStatus is the current status of a persistent volume claim. + """ + + accessModes = ListField(six.text_type) + capacity = Field(dict) + conditions = ListField(PersistentVolumeClaimCondition) + phase = Field(six.text_type) + + +class PersistentVolumeClaim(Model): + """ + PersistentVolumeClaim is a user's request for and claim to a persistent volume + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + get_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + list_all_url = "/api/v1/persistentvolumeclaims" + list_ns_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" + update_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaim") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeClaimSpec) + status = ReadOnlyField(PersistentVolumeClaimStatus) + + +class PersistentVolumeClaimList(Model): + """ + PersistentVolumeClaimList is a list of PersistentVolumeClaim items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeClaimList") + + items = ListField(PersistentVolumeClaim) + metadata = Field(ListMeta) + + +class ObjectReference(Model): + """ + ObjectReference contains enough information to let you inspect or modify the + referred object. + """ + + fieldPath = Field(six.text_type) + name = Field(six.text_type) + namespace = Field(six.text_type) + resourceVersion = Field(six.text_type) + uid = Field(six.text_type) + + +class StorageOSPersistentVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(ObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class NodeConfigSource(Model): + """ + NodeConfigSource specifies a source of node configuration. Exactly one subfield + (excluding metadata) must be non-nil. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeConfigSource") + + configMapRef = Field(ObjectReference) + + +class NodeSpec(Model): + """ + NodeSpec describes the attributes that a node is created with. + """ + + configSource = Field(NodeConfigSource) + externalID = Field(six.text_type) + podCIDR = Field(six.text_type) + providerID = Field(six.text_type) + taints = ListField(Taint) + unschedulable = Field(bool) + + +class EndpointAddress(Model): + """ + EndpointAddress is a tuple that describes single IP address. + """ + + hostname = Field(six.text_type) + ip = RequiredField(six.text_type) + nodeName = Field(six.text_type) + targetRef = Field(ObjectReference) + + +class Binding(Model): + """ + Binding ties one object to another; for example, a pod is bound to a node by a + scheduler. Deprecated in 1.7, please use the bindings subresource of pods + instead. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Binding") + + metadata = Field(ObjectMeta) + target = RequiredField(ObjectReference) + + +class ObjectFieldSelector(Model): + """ + ObjectFieldSelector selects an APIVersioned field of an object. + """ + + fieldPath = RequiredField(six.text_type) + + +class DownwardAPIVolumeFile(Model): + """ + DownwardAPIVolumeFile represents information to create the file containing the + pod field + """ + + fieldRef = Field(ObjectFieldSelector) + mode = Field(int) + path = RequiredField(six.text_type) + resourceFieldRef = Field(ResourceFieldSelector) + + +class DownwardAPIVolumeSource(Model): + """ + DownwardAPIVolumeSource represents a volume containing downward API info. + Downward API volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(DownwardAPIVolumeFile) + + +class DownwardAPIProjection(Model): + """ + Represents downward API info for projecting into a projected volume. Note that + this is identical to a downwardAPI volume source without the default mode. + """ + + items = ListField(DownwardAPIVolumeFile) + + +class NodeSystemInfo(Model): + """ + NodeSystemInfo is a set of ids/uuids to uniquely identify the node. + """ + + architecture = RequiredField(six.text_type) + bootID = RequiredField(six.text_type) + containerRuntimeVersion = RequiredField(six.text_type) + kernelVersion = RequiredField(six.text_type) + kubeProxyVersion = RequiredField(six.text_type) + kubeletVersion = RequiredField(six.text_type) + machineID = RequiredField(six.text_type) + operatingSystem = RequiredField(six.text_type) + osImage = RequiredField(six.text_type) + systemUUID = RequiredField(six.text_type) + + +class NodeSelectorRequirement(Model): + """ + A node selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class NodeSelectorTerm(Model): + """ + A null or empty node selector term matches no objects. + """ + + matchExpressions = ListField(NodeSelectorRequirement) + + +class PreferredSchedulingTerm(Model): + """ + An empty preferred scheduling term matches all objects with implicit weight 0 + (i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. + is also a no-op). + """ + + preference = RequiredField(NodeSelectorTerm) + weight = RequiredField(int) + + +class NodeSelector(Model): + """ + A node selector represents the union of the results of one or more label + queries over a set of nodes; that is, it represents the OR of the selectors + represented by the node selector terms. + """ + + nodeSelectorTerms = ListField(NodeSelectorTerm) + + +class NodeAffinity(Model): + """ + Node affinity is a group of node affinity scheduling rules. + """ + + preferredDuringSchedulingIgnoredDuringExecution = ListField(PreferredSchedulingTerm) + requiredDuringSchedulingIgnoredDuringExecution = Field(NodeSelector) + + +class Affinity(Model): + """ + Affinity is a group of affinity scheduling rules. + """ + + nodeAffinity = Field(NodeAffinity) + podAffinity = Field(PodAffinity) + podAntiAffinity = Field(PodAntiAffinity) + + +class NodeCondition(Model): + """ + NodeCondition contains condition information for a node. + """ + + lastHeartbeatTime = Field(datetime.datetime) + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NodeAddress(Model): + """ + NodeAddress contains information for the node's address. + """ + + address = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class NamespaceStatus(Model): + """ + NamespaceStatus is information about the current status of a Namespace. + """ + + phase = Field(six.text_type) + + +class NamespaceSpec(Model): + """ + NamespaceSpec describes the attributes on a Namespace. + """ + + finalizers = ListField(six.text_type) + + +class Namespace(Model): + """ + Namespace provides a scope for Names. Use of multiple namespaces is optional. + """ + class Meta: + create_url = "/api/v1/namespaces" + delete_url = "/api/v1/namespaces/{name}" + get_url = "/api/v1/namespaces/{name}" + list_all_url = "/api/v1/namespaces" + update_url = "/api/v1/namespaces/{name}" + watch_url = "/api/v1/watch/namespaces/{name}" + watchlist_all_url = "/api/v1/watch/namespaces" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Namespace") + + metadata = Field(ObjectMeta) + spec = Field(NamespaceSpec) + status = Field(NamespaceStatus) + + +class NamespaceList(Model): + """ + NamespaceList is a list of Namespaces. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NamespaceList") + + items = ListField(Namespace) + metadata = Field(ListMeta) + + +class NFSVolumeSource(Model): + """ + Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not + support ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + readOnly = Field(bool) + server = RequiredField(six.text_type) + + +class LocalVolumeSource(Model): + """ + Local represents directly-attached storage with node affinity + """ + + path = RequiredField(six.text_type) + + +class LocalObjectReference(Model): + """ + LocalObjectReference contains enough information to let you locate the + referenced object inside the same namespace. + """ + + name = Field(six.text_type) + + +class StorageOSVolumeSource(Model): + """ + Represents a StorageOS persistent volume resource. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + volumeName = Field(six.text_type) + volumeNamespace = Field(six.text_type) + + +class ServiceAccount(Model): + """ + ServiceAccount binds together: * a name, understood by users, and perhaps by + peripheral systems, for an identity * a principal that can be authenticated and + authorized * a set of secrets + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + get_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + list_all_url = "/api/v1/serviceaccounts" + list_ns_url = "/api/v1/namespaces/{namespace}/serviceaccounts" + update_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" + watchlist_all_url = "/api/v1/watch/serviceaccounts" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccount") + + automountServiceAccountToken = Field(bool) + imagePullSecrets = ListField(LocalObjectReference) + metadata = Field(ObjectMeta) + secrets = ListField(ObjectReference) + + +class ServiceAccountList(Model): + """ + ServiceAccountList is a list of ServiceAccount objects + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceAccountList") + + items = ListField(ServiceAccount) + metadata = Field(ListMeta) + + +class ScaleIOVolumeSource(Model): + """ + ScaleIOVolumeSource represents a persistent ScaleIO volume + """ + + fsType = Field(six.text_type) + gateway = RequiredField(six.text_type) + protectionDomain = Field(six.text_type) + readOnly = Field(bool) + secretRef = RequiredField(LocalObjectReference) + sslEnabled = Field(bool) + storageMode = Field(six.text_type) + storagePool = Field(six.text_type) + system = RequiredField(six.text_type) + volumeName = Field(six.text_type) + + +class RBDVolumeSource(Model): + """ + Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + image = RequiredField(six.text_type) + keyring = Field(six.text_type) + monitors = ListField(six.text_type) + pool = Field(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class ISCSIVolumeSource(Model): + """ + Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. + ISCSI volumes support ownership management and SELinux relabeling. + """ + + chapAuthDiscovery = Field(bool) + chapAuthSession = Field(bool) + fsType = Field(six.text_type) + initiatorName = Field(six.text_type) + iqn = RequiredField(six.text_type) + iscsiInterface = Field(six.text_type) + lun = RequiredField(int) + portals = ListField(six.text_type) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + targetPortal = RequiredField(six.text_type) + + +class FlexVolumeSource(Model): + """ + FlexVolume represents a generic volume resource that is provisioned/attached + using an exec based plugin. + """ + + driver = RequiredField(six.text_type) + fsType = Field(six.text_type) + options = Field(dict) + readOnly = Field(bool) + secretRef = Field(LocalObjectReference) + + +class CephFSVolumeSource(Model): + """ + Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs + volumes do not support ownership management or SELinux relabeling. + """ + + monitors = ListField(six.text_type) + path = Field(six.text_type) + readOnly = Field(bool) + secretFile = Field(six.text_type) + secretRef = Field(LocalObjectReference) + user = Field(six.text_type) + + +class LoadBalancerIngress(Model): + """ + LoadBalancerIngress represents the status of a load-balancer ingress point: + traffic intended for the service should be sent to an ingress point. + """ + + hostname = Field(six.text_type) + ip = Field(six.text_type) + + +class LoadBalancerStatus(Model): + """ + LoadBalancerStatus represents the status of a load-balancer. + """ + + ingress = ListField(LoadBalancerIngress) + + +class ServiceStatus(Model): + """ + ServiceStatus represents the current status of a service. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class LimitRangeItem(Model): + """ + LimitRangeItem defines a min/max usage limit for any resource that matches on + kind. + """ + + default = Field(dict) + defaultRequest = Field(dict) + max = Field(dict) + maxLimitRequestRatio = Field(dict) + min = Field(dict) + type = Field(six.text_type) + + +class LimitRangeSpec(Model): + """ + LimitRangeSpec defines a min/max usage limit for resources that match on kind. + """ + + limits = ListField(LimitRangeItem) + + +class LimitRange(Model): + """ + LimitRange sets resource usage limits for each kind of resource in a Namespace. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/limitranges" + delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + get_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + list_all_url = "/api/v1/limitranges" + list_ns_url = "/api/v1/namespaces/{namespace}/limitranges" + update_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" + watchlist_all_url = "/api/v1/watch/limitranges" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRange") + + metadata = Field(ObjectMeta) + spec = Field(LimitRangeSpec) + + +class LimitRangeList(Model): + """ + LimitRangeList is a list of LimitRange items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "LimitRangeList") + + items = ListField(LimitRange) + metadata = Field(ListMeta) + + +class KeyToPath(Model): + """ + Maps a string key to a path within a volume. + """ + + key = RequiredField(six.text_type) + mode = Field(int) + path = RequiredField(six.text_type) + + +class SecretVolumeSource(Model): + """ + Adapts a Secret into a volume. + + The contents of the target Secret's Data field + will be presented in a volume as files using the keys in the Data field as the + file names. Secret volumes support ownership management and SELinux relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + optional = Field(bool) + secretName = Field(six.text_type) + + +class SecretProjection(Model): + """ + Adapts a secret into a projected volume. + + The contents of the target Secret's + Data field will be presented in a projected volume as files using the keys in + the Data field as the file names. Note that this is identical to a secret + volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapVolumeSource(Model): + """ + Adapts a ConfigMap into a volume. + + The contents of the target ConfigMap's Data + field will be presented in a volume as files using the keys in the Data field + as the file names, unless the items element is populated with specific mappings + of keys to paths. ConfigMap volumes support ownership management and SELinux + relabeling. + """ + + defaultMode = Field(int) + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class ConfigMapProjection(Model): + """ + Adapts a ConfigMap into a projected volume. + + The contents of the target + ConfigMap's Data field will be presented in a projected volume as files using + the keys in the Data field as the file names, unless the items element is + populated with specific mappings of keys to paths. Note that this is identical + to a configmap volume source without the default mode. + """ + + items = ListField(KeyToPath) + name = Field(six.text_type) + optional = Field(bool) + + +class VolumeProjection(Model): + """ + Projection that may be projected along with other supported volume types + """ + + configMap = Field(ConfigMapProjection) + downwardAPI = Field(DownwardAPIProjection) + secret = Field(SecretProjection) + + +class ProjectedVolumeSource(Model): + """ + Represents a projected volume source + """ + + defaultMode = Field(int) + sources = ListField(VolumeProjection) + + +class HostPathVolumeSource(Model): + """ + Represents a host path mapped into a pod. Host path volumes do not support + ownership management or SELinux relabeling. + """ + + path = RequiredField(six.text_type) + type = Field(six.text_type) + + +class HostAlias(Model): + """ + HostAlias holds the mapping between IP and hostnames that will be injected as + an entry in the pod's hosts file. + """ + + hostnames = ListField(six.text_type) + ip = Field(six.text_type) + + +class HTTPHeader(Model): + """ + HTTPHeader describes a custom header to be used in HTTP probes + """ + + name = RequiredField(six.text_type) + value = RequiredField(six.text_type) + + +class HTTPGetAction(Model): + """ + HTTPGetAction describes an action based on HTTP Get requests. + """ + + host = Field(six.text_type) + httpHeaders = ListField(HTTPHeader) + path = Field(six.text_type) + port = RequiredField(six.text_type, alt_type=int) + scheme = Field(six.text_type) + + +class GlusterfsVolumeSource(Model): + """ + Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs + volumes do not support ownership management or SELinux relabeling. + """ + + endpoints = RequiredField(six.text_type) + path = RequiredField(six.text_type) + readOnly = Field(bool) + + +class GitRepoVolumeSource(Model): + """ + Represents a volume that is populated with the contents of a git repository. + Git repo volumes do not support ownership management. Git repo volumes support + SELinux relabeling. + """ + + directory = Field(six.text_type) + repository = RequiredField(six.text_type) + revision = Field(six.text_type) + + +class GCEPersistentDiskVolumeSource(Model): + """ + Represents a Persistent Disk resource in Google Compute Engine. + + A GCE PD must + exist before mounting to a container. The disk must also be in the same GCE + project and zone as the kubelet. A GCE PD can only be mounted as read/write + once or read-only many times. GCE PDs support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + pdName = RequiredField(six.text_type) + readOnly = Field(bool) + + +class FlockerVolumeSource(Model): + """ + Represents a Flocker volume mounted by the Flocker agent. One and only one of + datasetName and datasetUUID should be set. Flocker volumes do not support + ownership management or SELinux relabeling. + """ + + datasetName = Field(six.text_type) + datasetUUID = Field(six.text_type) + + +class FCVolumeSource(Model): + """ + Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as + read/write once. Fibre Channel volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + lun = Field(int) + readOnly = Field(bool) + targetWWNs = ListField(six.text_type) + wwids = ListField(six.text_type) + + +class ExecAction(Model): + """ + ExecAction describes a 'run in container' action. + """ + + command = ListField(six.text_type) + + +class Probe(Model): + """ + Probe describes a health check to be performed against a container to determine + whether it is alive or ready to receive traffic. + """ + + _exec = Field(ExecAction) + failureThreshold = Field(int) + httpGet = Field(HTTPGetAction) + initialDelaySeconds = Field(int) + periodSeconds = Field(int) + successThreshold = Field(int) + tcpSocket = Field(TCPSocketAction) + timeoutSeconds = Field(int) + + +class Handler(Model): + """ + Handler defines a specific action that should be taken + """ + + _exec = Field(ExecAction) + httpGet = Field(HTTPGetAction) + tcpSocket = Field(TCPSocketAction) + + +class Lifecycle(Model): + """ + Lifecycle describes actions that the management system should take in response + to container lifecycle events. For the PostStart and PreStop lifecycle + handlers, management of the container blocks until the action is complete, + unless the container process fails, in which case the handler is aborted. + """ + + postStart = Field(Handler) + preStop = Field(Handler) + + +class EventSource(Model): + """ + EventSource contains information for an event. + """ + + component = Field(six.text_type) + host = Field(six.text_type) + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continously for some time. + """ + + count = Field(int) + lastObservedTime = Field(datetime.datetime) + state = Field(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/events" + delete_url = "/api/v1/namespaces/{namespace}/events/{name}" + get_url = "/api/v1/namespaces/{namespace}/events/{name}" + list_all_url = "/api/v1/events" + list_ns_url = "/api/v1/namespaces/{namespace}/events" + update_url = "/api/v1/namespaces/{namespace}/events/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/api/v1/watch/events" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + count = Field(int) + eventTime = Field(datetime.datetime) + firstTimestamp = Field(datetime.datetime) + involvedObject = RequiredField(ObjectReference) + lastTimestamp = Field(datetime.datetime) + message = Field(six.text_type) + metadata = RequiredField(ObjectMeta) + reason = Field(six.text_type) + related = Field(ObjectReference) + reportingComponent = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + source = Field(EventSource) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of events. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + + +class EndpointPort(Model): + """ + EndpointPort is a tuple that describes a single port. + """ + + name = Field(six.text_type) + port = RequiredField(int) + protocol = Field(six.text_type) + + +class EndpointSubset(Model): + """ + EndpointSubset is a group of addresses with a common set of ports. The expanded + set of endpoints is the Cartesian product of Addresses x Ports. For example, + given: + { + Addresses: [{'ip': '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, {'name': 'b', 'port': 309}] + } + The + resulting set of endpoints can be viewed as: + a: [ 10.10.1.1:8675, + 10.10.2.2:8675 ], + b: [ 10.10.1.1:309, 10.10.2.2:309 ] + """ + + addresses = ListField(EndpointAddress) + notReadyAddresses = ListField(EndpointAddress) + ports = ListField(EndpointPort) + + +class Endpoints(Model): + """ + Endpoints is a collection of endpoints that implement the actual service. + Example: + Name: 'mysvc', + Subsets: [ + { + Addresses: [{'ip': + '10.10.1.1'}, {'ip': '10.10.2.2'}], + Ports: [{'name': 'a', 'port': 8675}, + {'name': 'b', 'port': 309}] + }, + { + Addresses: [{'ip': + '10.10.3.3'}], + Ports: [{'name': 'a', 'port': 93}, {'name': 'b', 'port': + 76}] + }, + ] + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/endpoints" + delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + get_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + list_all_url = "/api/v1/endpoints" + list_ns_url = "/api/v1/namespaces/{namespace}/endpoints" + update_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" + watchlist_all_url = "/api/v1/watch/endpoints" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Endpoints") + + metadata = Field(ObjectMeta) + subsets = ListField(EndpointSubset) + + +class EndpointsList(Model): + """ + EndpointsList is a list of endpoints. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "EndpointsList") + + items = ListField(Endpoints) + metadata = Field(ListMeta) + + +class EmptyDirVolumeSource(Model): + """ + Represents an empty directory for a pod. Empty directory volumes support + ownership management and SELinux relabeling. + """ + + medium = Field(six.text_type) + sizeLimit = Field(six.text_type) + + +class DaemonEndpoint(Model): + """ + DaemonEndpoint contains information about a single Daemon endpoint. + """ + + Port = RequiredField(int) + + +class NodeDaemonEndpoints(Model): + """ + NodeDaemonEndpoints lists ports opened by daemons running on the Node. + """ + + kubeletEndpoint = Field(DaemonEndpoint) + + +class ContainerStateWaiting(Model): + """ + ContainerStateWaiting is a waiting state of a container. + """ + + message = Field(six.text_type) + reason = Field(six.text_type) + + +class ContainerStateTerminated(Model): + """ + ContainerStateTerminated is a terminated state of a container. + """ + + containerID = Field(six.text_type) + exitCode = RequiredField(int) + finishedAt = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + signal = Field(int) + startedAt = Field(datetime.datetime) + + +class ContainerStateRunning(Model): + """ + ContainerStateRunning is a running state of a container. + """ + + startedAt = Field(datetime.datetime) + + +class ContainerState(Model): + """ + ContainerState holds a possible state of container. Only one of its members may + be specified. If none of them is specified, the default one is + ContainerStateWaiting. + """ + + running = Field(ContainerStateRunning) + terminated = Field(ContainerStateTerminated) + waiting = Field(ContainerStateWaiting) + + +class ContainerStatus(Model): + """ + ContainerStatus contains details for the current status of this container. + """ + + containerID = Field(six.text_type) + image = RequiredField(six.text_type) + imageID = RequiredField(six.text_type) + lastState = Field(ContainerState) + name = RequiredField(six.text_type) + ready = RequiredField(bool) + restartCount = RequiredField(int) + state = Field(ContainerState) + + +class PodStatus(Model): + """ + PodStatus represents information about the status of a pod. Status may trail + the actual state of a system. + """ + + conditions = ListField(PodCondition) + containerStatuses = ListField(ContainerStatus) + hostIP = Field(six.text_type) + initContainerStatuses = ListField(ContainerStatus) + message = Field(six.text_type) + phase = Field(six.text_type) + podIP = Field(six.text_type) + qosClass = Field(six.text_type) + reason = Field(six.text_type) + startTime = Field(datetime.datetime) + + +class ContainerPort(Model): + """ + ContainerPort represents a network port in a single container. + """ + + containerPort = RequiredField(int) + hostIP = Field(six.text_type) + hostPort = Field(int) + name = Field(six.text_type) + protocol = Field(six.text_type) + + +class ContainerImage(Model): + """ + Describe a container image + """ + + names = ListField(six.text_type) + sizeBytes = Field(int) + + +class ConfigMapKeySelector(Model): + """ + Selects a key from a ConfigMap. + """ + + key = RequiredField(six.text_type) + name = Field(six.text_type) + optional = Field(bool) + + +class EnvVarSource(Model): + """ + EnvVarSource represents a source for the value of an EnvVar. + """ + + configMapKeyRef = Field(ConfigMapKeySelector) + fieldRef = Field(ObjectFieldSelector) + resourceFieldRef = Field(ResourceFieldSelector) + secretKeyRef = Field(SecretKeySelector) + + +class EnvVar(Model): + """ + EnvVar represents an environment variable present in a Container. + """ + + name = RequiredField(six.text_type) + value = Field(six.text_type) + valueFrom = Field(EnvVarSource) + + +class ConfigMapEnvSource(Model): + """ + ConfigMapEnvSource selects a ConfigMap to populate the environment variables + with. + + The contents of the target ConfigMap's Data field will represent the + key-value pairs as environment variables. + """ + + name = Field(six.text_type) + optional = Field(bool) + + +class EnvFromSource(Model): + """ + EnvFromSource represents the source of a set of ConfigMaps + """ + + configMapRef = Field(ConfigMapEnvSource) + prefix = Field(six.text_type) + secretRef = Field(SecretEnvSource) + + +class ConfigMap(Model): + """ + ConfigMap holds configuration data for pods to consume. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/configmaps" + delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + get_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + list_all_url = "/api/v1/configmaps" + list_ns_url = "/api/v1/namespaces/{namespace}/configmaps" + update_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" + watchlist_all_url = "/api/v1/watch/configmaps" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMap") + + data = Field(dict) + metadata = Field(ObjectMeta) + + +class ConfigMapList(Model): + """ + ConfigMapList is a resource containing a list of ConfigMap objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ConfigMapList") + + items = ListField(ConfigMap) + metadata = Field(ListMeta) + + +class ComponentCondition(Model): + """ + Information about the condition of a component. + """ + + error = Field(six.text_type) + message = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ComponentStatus(Model): + """ + ComponentStatus (and ComponentStatusList) holds the cluster validation info. + """ + class Meta: + get_url = "/api/v1/componentstatuses/{name}" + list_all_url = "/api/v1/componentstatuses" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatus") + + conditions = ListField(ComponentCondition) + metadata = Field(ObjectMeta) + + +class ComponentStatusList(Model): + """ + Status of all the conditions for the component as a list of ComponentStatus + objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ComponentStatusList") + + items = ListField(ComponentStatus) + metadata = Field(ListMeta) + + +class ClientIPConfig(Model): + """ + ClientIPConfig represents the configurations of Client IP based session + affinity. + """ + + timeoutSeconds = Field(int) + + +class SessionAffinityConfig(Model): + """ + SessionAffinityConfig represents the configurations of session affinity. + """ + + clientIP = Field(ClientIPConfig) + + +class ServiceSpec(Model): + """ + ServiceSpec describes the attributes that a user creates on a service. + """ + + clusterIP = Field(six.text_type) + externalIPs = ListField(six.text_type) + externalName = Field(six.text_type) + externalTrafficPolicy = Field(six.text_type) + healthCheckNodePort = Field(int) + loadBalancerIP = Field(six.text_type) + loadBalancerSourceRanges = ListField(six.text_type) + ports = ListField(ServicePort) + publishNotReadyAddresses = Field(bool) + selector = Field(dict) + sessionAffinity = Field(six.text_type) + sessionAffinityConfig = Field(SessionAffinityConfig) + type = Field(six.text_type) + + +class Service(Model): + """ + Service is a named abstraction of software service (for example, mysql) + consisting of local port (for example 3306) that the proxy listens on, and the + selector that determines which pods will answer requests sent through the + proxy. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/services" + delete_url = "/api/v1/namespaces/{namespace}/services/{name}" + get_url = "/api/v1/namespaces/{namespace}/services/{name}" + list_all_url = "/api/v1/services" + list_ns_url = "/api/v1/namespaces/{namespace}/services" + update_url = "/api/v1/namespaces/{namespace}/services/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" + watchlist_all_url = "/api/v1/watch/services" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Service") + + metadata = Field(ObjectMeta) + spec = Field(ServiceSpec) + status = ReadOnlyField(ServiceStatus) + + +class ServiceList(Model): + """ + ServiceList holds a list of services. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ServiceList") + + items = ListField(Service) + metadata = Field(ListMeta) + + +class CinderVolumeSource(Model): + """ + Represents a cinder volume resource in Openstack. A Cinder volume must exist + before mounting to a container. The volume must also be in the same region as + the kubelet. Cinder volumes support ownership management and SELinux + relabeling. + """ + + fsType = Field(six.text_type) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Capabilities(Model): + """ + Adds and removes POSIX capabilities from running containers. + """ + + add = ListField(six.text_type) + drop = ListField(six.text_type) + + +class SecurityContext(Model): + """ + SecurityContext holds security configuration that will be applied to a + container. Some fields are present in both SecurityContext and + PodSecurityContext. When both are set, the values in SecurityContext take + precedence. + """ + + allowPrivilegeEscalation = Field(bool) + capabilities = Field(Capabilities) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + runAsNonRoot = Field(bool) + runAsUser = Field(int) + seLinuxOptions = Field(SELinuxOptions) + + +class Container(Model): + """ + A single application container that you want to run within a pod. + """ + + args = ListField(six.text_type) + command = ListField(six.text_type) + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + image = Field(six.text_type) + imagePullPolicy = Field(six.text_type) + lifecycle = Field(Lifecycle) + livenessProbe = Field(Probe) + name = RequiredField(six.text_type) + ports = ListField(ContainerPort) + readinessProbe = Field(Probe) + resources = Field(ResourceRequirements) + securityContext = Field(SecurityContext) + stdin = Field(bool) + stdinOnce = Field(bool) + terminationMessagePath = Field(six.text_type) + terminationMessagePolicy = Field(six.text_type) + tty = Field(bool) + volumeDevices = ListField(VolumeDevice) + volumeMounts = ListField(VolumeMount) + workingDir = Field(six.text_type) + + +class CSIPersistentVolumeSource(Model): + """ + Represents storage that is managed by an external CSI volume driver + """ + + driver = RequiredField(six.text_type) + readOnly = Field(bool) + volumeHandle = RequiredField(six.text_type) + + +class AzureFileVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureFilePersistentVolumeSource(Model): + """ + AzureFile represents an Azure File Service mount on the host and bind mount to + the pod. + """ + + readOnly = Field(bool) + secretName = RequiredField(six.text_type) + secretNamespace = Field(six.text_type) + shareName = RequiredField(six.text_type) + + +class AzureDiskVolumeSource(Model): + """ + AzureDisk represents an Azure Data Disk mount on the host and bind mount to the + pod. + """ + + cachingMode = Field(six.text_type) + diskName = RequiredField(six.text_type) + diskURI = RequiredField(six.text_type) + fsType = Field(six.text_type) + readOnly = Field(bool) + + +class AttachedVolume(Model): + """ + AttachedVolume describes a volume attached to a node + """ + + devicePath = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class NodeStatus(Model): + """ + NodeStatus is information about the current status of a node. + """ + + addresses = ListField(NodeAddress) + allocatable = Field(dict) + capacity = Field(dict) + conditions = ListField(NodeCondition) + daemonEndpoints = Field(NodeDaemonEndpoints) + images = ListField(ContainerImage) + nodeInfo = Field(NodeSystemInfo) + phase = Field(six.text_type) + volumesAttached = ListField(AttachedVolume) + volumesInUse = ListField(six.text_type) + + +class Node(Model): + """ + Node is a worker node in Kubernetes. Each node will have a unique identifier in + the cache (i.e. in etcd). + """ + class Meta: + create_url = "/api/v1/nodes" + delete_url = "/api/v1/nodes/{name}" + get_url = "/api/v1/nodes/{name}" + list_all_url = "/api/v1/nodes" + update_url = "/api/v1/nodes/{name}" + watch_url = "/api/v1/watch/nodes/{name}" + watchlist_all_url = "/api/v1/watch/nodes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Node") + + metadata = Field(ObjectMeta) + spec = Field(NodeSpec) + status = ReadOnlyField(NodeStatus) + + +class NodeList(Model): + """ + NodeList is the whole list of all Nodes which have been registered with master. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "NodeList") + + items = ListField(Node) + metadata = Field(ListMeta) + + +class AWSElasticBlockStoreVolumeSource(Model): + """ + Represents a Persistent Disk resource in AWS. + + An AWS EBS disk must exist + before mounting to a container. The disk must also be in the same AWS zone as + the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS + volumes support ownership management and SELinux relabeling. + """ + + fsType = Field(six.text_type) + partition = Field(int) + readOnly = Field(bool) + volumeID = RequiredField(six.text_type) + + +class Volume(Model): + """ + Volume represents a named volume in a pod that may be accessed by any container + in the pod. + """ + + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFileVolumeSource) + cephfs = Field(CephFSVolumeSource) + cinder = Field(CinderVolumeSource) + configMap = Field(ConfigMapVolumeSource) + downwardAPI = Field(DownwardAPIVolumeSource) + emptyDir = Field(EmptyDirVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + gitRepo = Field(GitRepoVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIVolumeSource) + name = RequiredField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeClaim = Field(PersistentVolumeClaimVolumeSource) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + projected = Field(ProjectedVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDVolumeSource) + scaleIO = Field(ScaleIOVolumeSource) + secret = Field(SecretVolumeSource) + storageos = Field(StorageOSVolumeSource) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PodSpec(Model): + """ + PodSpec is a description of a pod. + """ + + activeDeadlineSeconds = Field(int) + affinity = Field(Affinity) + automountServiceAccountToken = Field(bool) + containers = ListField(Container) + dnsConfig = Field(PodDNSConfig) + dnsPolicy = Field(six.text_type) + hostAliases = ListField(HostAlias) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostname = Field(six.text_type) + imagePullSecrets = ListField(LocalObjectReference) + initContainers = ListField(Container) + nodeName = Field(six.text_type) + nodeSelector = Field(dict) + priority = Field(int) + priorityClassName = Field(six.text_type) + restartPolicy = Field(six.text_type) + schedulerName = Field(six.text_type) + securityContext = Field(PodSecurityContext) + serviceAccount = Field(six.text_type) + serviceAccountName = Field(six.text_type) + subdomain = Field(six.text_type) + terminationGracePeriodSeconds = Field(int) + tolerations = ListField(Toleration) + volumes = ListField(Volume) + + +class PodTemplateSpec(Model): + """ + PodTemplateSpec describes the data a pod should have when created from a + template + """ + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + + +class ReplicationControllerSpec(Model): + """ + ReplicationControllerSpec is the specification of a replication controller. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(dict) + template = Field(PodTemplateSpec) + + +class ReplicationController(Model): + """ + ReplicationController represents the configuration of a replication controller. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + get_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + list_all_url = "/api/v1/replicationcontrollers" + list_ns_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" + update_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" + watchlist_all_url = "/api/v1/watch/replicationcontrollers" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationController") + + metadata = Field(ObjectMeta) + spec = Field(ReplicationControllerSpec) + status = ReadOnlyField(ReplicationControllerStatus) + + +class ReplicationControllerList(Model): + """ + ReplicationControllerList is a collection of replication controllers. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "ReplicationControllerList") + + items = ListField(ReplicationController) + metadata = Field(ListMeta) + + +class PodTemplate(Model): + """ + PodTemplate describes a template for creating copies of a predefined pod. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/podtemplates" + delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + get_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + list_all_url = "/api/v1/podtemplates" + list_ns_url = "/api/v1/namespaces/{namespace}/podtemplates" + update_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" + watchlist_all_url = "/api/v1/watch/podtemplates" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplate") + + metadata = Field(ObjectMeta) + template = Field(PodTemplateSpec) + + +class PodTemplateList(Model): + """ + PodTemplateList is a list of PodTemplates. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodTemplateList") + + items = ListField(PodTemplate) + metadata = Field(ListMeta) + + +class Pod(Model): + """ + Pod is a collection of containers that can run on a host. This resource is + created by clients and scheduled onto hosts. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods" + delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" + get_url = "/api/v1/namespaces/{namespace}/pods/{name}" + list_all_url = "/api/v1/pods" + list_ns_url = "/api/v1/namespaces/{namespace}/pods" + update_url = "/api/v1/namespaces/{namespace}/pods/{name}" + watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" + watchlist_all_url = "/api/v1/watch/pods" + watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Pod") + + metadata = Field(ObjectMeta) + spec = Field(PodSpec) + status = ReadOnlyField(PodStatus) + + +class PodList(Model): + """ + PodList is a list of Pods. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PodList") + + items = ListField(Pod) + metadata = Field(ListMeta) + + +class PersistentVolumeSpec(Model): + """ + PersistentVolumeSpec is the specification of a persistent volume. + """ + + accessModes = ListField(six.text_type) + awsElasticBlockStore = Field(AWSElasticBlockStoreVolumeSource) + azureDisk = Field(AzureDiskVolumeSource) + azureFile = Field(AzureFilePersistentVolumeSource) + capacity = Field(dict) + cephfs = Field(CephFSPersistentVolumeSource) + cinder = Field(CinderVolumeSource) + claimRef = Field(ObjectReference) + csi = Field(CSIPersistentVolumeSource) + fc = Field(FCVolumeSource) + flexVolume = Field(FlexVolumeSource) + flocker = Field(FlockerVolumeSource) + gcePersistentDisk = Field(GCEPersistentDiskVolumeSource) + glusterfs = Field(GlusterfsVolumeSource) + hostPath = Field(HostPathVolumeSource) + iscsi = Field(ISCSIPersistentVolumeSource) + local = Field(LocalVolumeSource) + mountOptions = ListField(six.text_type) + nfs = Field(NFSVolumeSource) + persistentVolumeReclaimPolicy = Field(six.text_type) + photonPersistentDisk = Field(PhotonPersistentDiskVolumeSource) + portworxVolume = Field(PortworxVolumeSource) + quobyte = Field(QuobyteVolumeSource) + rbd = Field(RBDPersistentVolumeSource) + scaleIO = Field(ScaleIOPersistentVolumeSource) + storageClassName = Field(six.text_type) + storageos = Field(StorageOSPersistentVolumeSource) + volumeMode = Field(six.text_type) + vsphereVolume = Field(VsphereVirtualDiskVolumeSource) + + +class PersistentVolume(Model): + """ + PersistentVolume (PV) is a storage resource provisioned by an administrator. It + is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage + /persistent-volumes + """ + class Meta: + create_url = "/api/v1/persistentvolumes" + delete_url = "/api/v1/persistentvolumes/{name}" + get_url = "/api/v1/persistentvolumes/{name}" + list_all_url = "/api/v1/persistentvolumes" + update_url = "/api/v1/persistentvolumes/{name}" + watch_url = "/api/v1/watch/persistentvolumes/{name}" + watchlist_all_url = "/api/v1/watch/persistentvolumes" + + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolume") + + metadata = Field(ObjectMeta) + spec = Field(PersistentVolumeSpec) + status = ReadOnlyField(PersistentVolumeStatus) + + +class PersistentVolumeList(Model): + """ + PersistentVolumeList is a list of PersistentVolume items. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "PersistentVolumeList") + + items = ListField(PersistentVolume) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/events/__init__.py b/k8s/models/v1_9/api/events/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/events/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/events/v1beta1.py b/k8s/models/v1_9/api/events/v1beta1.py new file mode 100644 index 0000000..6420d71 --- /dev/null +++ b/k8s/models/v1_9/api/events/v1beta1.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.api.core.v1 import EventSource, ObjectReference +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class EventSeries(Model): + """ + EventSeries contain information on series of events, i.e. thing that was/is + happening continously for some time. + """ + + count = RequiredField(int) + lastObservedTime = RequiredField(datetime.datetime) + state = RequiredField(six.text_type) + + +class Event(Model): + """ + Event is a report of an event somewhere in the cluster. It generally denotes + some state change in the system. + """ + class Meta: + create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + get_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + list_all_url = "/apis/events.k8s.io/v1beta1/events" + list_ns_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" + update_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" + watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" + watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" + watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" + + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "Event") + + action = Field(six.text_type) + deprecatedCount = Field(int) + deprecatedFirstTimestamp = Field(datetime.datetime) + deprecatedLastTimestamp = Field(datetime.datetime) + deprecatedSource = Field(EventSource) + eventTime = RequiredField(datetime.datetime) + metadata = Field(ObjectMeta) + note = Field(six.text_type) + reason = Field(six.text_type) + regarding = Field(ObjectReference) + related = Field(ObjectReference) + reportingController = Field(six.text_type) + reportingInstance = Field(six.text_type) + series = Field(EventSeries) + type = Field(six.text_type) + + +class EventList(Model): + """ + EventList is a list of Event objects. + """ + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") + kind = Field(six.text_type, "EventList") + + items = ListField(Event) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/extensions/__init__.py b/k8s/models/v1_9/api/extensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/extensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/extensions/v1beta1.py b/k8s/models/v1_9/api/extensions/v1beta1.py new file mode 100644 index 0000000..d6c1dc7 --- /dev/null +++ b/k8s/models/v1_9/api/extensions/v1beta1.py @@ -0,0 +1,683 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.api.core.v1 import LoadBalancerStatus, PodTemplateSpec, SELinuxOptions +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ScaleStatus(Model): + """ + represents the current status of a scale subresource. + """ + + replicas = RequiredField(int) + selector = Field(dict) + targetSelector = Field(six.text_type) + + +class ScaleSpec(Model): + """ + describes the attributes of a scale subresource + """ + + replicas = Field(int) + + +class Scale(Model): + """ + represents a scaling request for a resource. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Scale") + + metadata = Field(ObjectMeta) + spec = Field(ScaleSpec) + status = ReadOnlyField(ScaleStatus) + + +class SELinuxStrategyOptions(Model): + """ + SELinux Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + rule = RequiredField(six.text_type) + seLinuxOptions = Field(SELinuxOptions) + + +class RollingUpdateDeployment(Model): + """ + Spec to control the desired behavior of rolling update. + """ + + maxSurge = Field(six.text_type, alt_type=int) + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DeploymentStrategy(Model): + """ + DeploymentStrategy describes how to replace existing pods with new ones. + """ + + rollingUpdate = Field(RollingUpdateDeployment) + type = Field(six.text_type) + + +class RollingUpdateDaemonSet(Model): + """ + Spec to control the desired behavior of daemon set rolling update. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + + +class DaemonSetUpdateStrategy(Model): + """ + + """ + + rollingUpdate = Field(RollingUpdateDaemonSet) + type = Field(six.text_type) + + +class DaemonSetSpec(Model): + """ + DaemonSetSpec is the specification of a daemon set. + """ + + minReadySeconds = Field(int) + revisionHistoryLimit = Field(int) + selector = Field(LabelSelector) + template = RequiredField(PodTemplateSpec) + templateGeneration = Field(int) + updateStrategy = Field(DaemonSetUpdateStrategy) + + +class RollbackConfig(Model): + """ + DEPRECATED. + """ + + revision = Field(int) + + +class DeploymentSpec(Model): + """ + DeploymentSpec is the specification of the desired behavior of the Deployment. + """ + + minReadySeconds = Field(int) + paused = Field(bool) + progressDeadlineSeconds = Field(int) + replicas = Field(int) + revisionHistoryLimit = Field(int) + rollbackTo = Field(RollbackConfig) + selector = Field(LabelSelector) + strategy = Field(DeploymentStrategy) + template = RequiredField(PodTemplateSpec) + + +class DeploymentRollback(Model): + """ + DEPRECATED. DeploymentRollback stores the information required to rollback a + deployment. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentRollback") + + name = RequiredField(six.text_type) + rollbackTo = RequiredField(RollbackConfig) + updatedAnnotations = Field(dict) + + +class ReplicaSetSpec(Model): + """ + ReplicaSetSpec is the specification of a ReplicaSet. + """ + + minReadySeconds = Field(int) + replicas = Field(int) + selector = Field(LabelSelector) + template = Field(PodTemplateSpec) + + +class ReplicaSetCondition(Model): + """ + ReplicaSetCondition describes the state of a replica set at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class ReplicaSetStatus(Model): + """ + ReplicaSetStatus represents the current status of a ReplicaSet. + """ + + availableReplicas = Field(int) + conditions = ListField(ReplicaSetCondition) + fullyLabeledReplicas = Field(int) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = RequiredField(int) + + +class ReplicaSet(Model): + """ + DEPRECATED - This group version of ReplicaSet is deprecated by + apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet + ensures that a specified number of pod replicas are running at any given time. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + list_all_url = "/apis/extensions/v1beta1/replicasets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSet") + + metadata = Field(ObjectMeta) + spec = Field(ReplicaSetSpec) + status = ReadOnlyField(ReplicaSetStatus) + + +class ReplicaSetList(Model): + """ + ReplicaSetList is a collection of ReplicaSets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "ReplicaSetList") + + items = ListField(ReplicaSet) + metadata = Field(ListMeta) + + +class NetworkPolicyPort(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPort is deprecated by + networking/v1/NetworkPolicyPort. + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IngressTLS(Model): + """ + IngressTLS describes the transport layer security associated with an Ingress. + """ + + hosts = ListField(six.text_type) + secretName = Field(six.text_type) + + +class IngressStatus(Model): + """ + IngressStatus describe the current state of the Ingress. + """ + + loadBalancer = Field(LoadBalancerStatus) + + +class IngressBackend(Model): + """ + IngressBackend describes all endpoints for a given service and port. + """ + + serviceName = RequiredField(six.text_type) + servicePort = RequiredField(six.text_type, alt_type=int) + + +class HTTPIngressPath(Model): + """ + HTTPIngressPath associates a path regex with a backend. Incoming urls matching + the path are forwarded to the backend. + """ + + backend = RequiredField(IngressBackend) + path = Field(six.text_type) + + +class HTTPIngressRuleValue(Model): + """ + HTTPIngressRuleValue is a list of http selectors pointing to backends. In the + example: http:///? -> backend where where parts of the + url correspond to RFC 3986, this resource will be used to match against + everything after the last '/' and before the first '?' or '#'. + """ + + paths = ListField(HTTPIngressPath) + + +class IngressRule(Model): + """ + IngressRule represents the rules mapping the paths under a specified host to + the related backend services. Incoming requests are first evaluated for a host + match, then routed to the backend associated with the matching + IngressRuleValue. + """ + + host = Field(six.text_type) + http = Field(HTTPIngressRuleValue) + + +class IngressSpec(Model): + """ + IngressSpec describes the Ingress the user wishes to exist. + """ + + backend = Field(IngressBackend) + rules = ListField(IngressRule) + tls = ListField(IngressTLS) + + +class Ingress(Model): + """ + Ingress is a collection of rules that allow inbound connections to reach the + endpoints defined by a backend. An Ingress can be configured to give services + externally-reachable urls, load balance traffic, terminate SSL, offer name + based virtual hosting etc. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + list_all_url = "/apis/extensions/v1beta1/ingresses" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Ingress") + + metadata = Field(ObjectMeta) + spec = Field(IngressSpec) + status = Field(IngressStatus) + + +class IngressList(Model): + """ + IngressList is a collection of Ingress. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "IngressList") + + items = ListField(Ingress) + metadata = Field(ListMeta) + + +class IPBlock(Model): + """ + DEPRECATED 1.9 - This group version of IPBlock is deprecated by + networking/v1/IPBlock. IPBlock describes a particular CIDR (Ex. + '192.168.1.1/24') that is allowed to the pods matched by a NetworkPolicySpec's + podSelector. The except entry describes CIDRs that should not be included + within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyPeer is deprecated by + networking/v1/NetworkPolicyPeer. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyIngressRule is deprecated + by networking/v1/NetworkPolicyIngressRule. This NetworkPolicyIngressRule + matches traffic if and only if the traffic matches both ports AND from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyEgressRule is deprecated by + networking/v1/NetworkPolicyEgressRule. NetworkPolicyEgressRule describes a + particular set of traffic that is allowed out of pods matched by a + NetworkPolicySpec's podSelector. The traffic must match both ports and to. This + type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicySpec is deprecated by + networking/v1/NetworkPolicySpec. + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicy is deprecated by + networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is + allowed for a set of Pods + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/networkpolicies" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + DEPRECATED 1.9 - This group version of NetworkPolicyList is deprecated by + networking/v1/NetworkPolicyList. Network Policy List is a list of NetworkPolicy + objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + + +class IDRange(Model): + """ + ID Range provides a min/max of an allowed range of IDs. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class SupplementalGroupsStrategyOptions(Model): + """ + SupplementalGroupsStrategyOptions defines the strategy type and options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class RunAsUserStrategyOptions(Model): + """ + Run A sUser Strategy Options defines the strategy type and any options used to + create the strategy. + """ + + ranges = ListField(IDRange) + rule = RequiredField(six.text_type) + + +class FSGroupStrategyOptions(Model): + """ + FSGroupStrategyOptions defines the strategy type and options used to create the + strategy. + """ + + ranges = ListField(IDRange) + rule = Field(six.text_type) + + +class HostPortRange(Model): + """ + Host Port Range defines a range of host ports that will be enabled by a policy + for pods to use. It requires both the start and end to be defined. + """ + + max = RequiredField(int) + min = RequiredField(int) + + +class DeploymentCondition(Model): + """ + DeploymentCondition describes the state of a deployment at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + lastUpdateTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DeploymentStatus(Model): + """ + DeploymentStatus is the most recently observed status of the Deployment. + """ + + availableReplicas = Field(int) + collisionCount = Field(int) + conditions = ListField(DeploymentCondition) + observedGeneration = Field(int) + readyReplicas = Field(int) + replicas = Field(int) + unavailableReplicas = Field(int) + updatedReplicas = Field(int) + + +class Deployment(Model): + """ + DEPRECATED - This group version of Deployment is deprecated by + apps/v1beta2/Deployment. See the release notes for more information. Deployment + enables declarative updates for Pods and ReplicaSets. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + list_all_url = "/apis/extensions/v1beta1/deployments" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "Deployment") + + metadata = Field(ObjectMeta) + spec = Field(DeploymentSpec) + status = Field(DeploymentStatus) + + +class DeploymentList(Model): + """ + DeploymentList is a list of Deployments. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DeploymentList") + + items = ListField(Deployment) + metadata = Field(ListMeta) + + +class DaemonSetCondition(Model): + """ + DaemonSetCondition describes the state of a DaemonSet at a certain point. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class DaemonSetStatus(Model): + """ + DaemonSetStatus represents the current status of a daemon set. + """ + + collisionCount = Field(int) + conditions = ListField(DaemonSetCondition) + currentNumberScheduled = RequiredField(int) + desiredNumberScheduled = RequiredField(int) + numberAvailable = Field(int) + numberMisscheduled = RequiredField(int) + numberReady = RequiredField(int) + numberUnavailable = Field(int) + observedGeneration = Field(int) + updatedNumberScheduled = Field(int) + + +class DaemonSet(Model): + """ + DEPRECATED - This group version of DaemonSet is deprecated by + apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet + represents the configuration of a daemon set. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + get_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + list_all_url = "/apis/extensions/v1beta1/daemonsets" + list_ns_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" + update_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" + watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" + watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSet") + + metadata = Field(ObjectMeta) + spec = Field(DaemonSetSpec) + status = ReadOnlyField(DaemonSetStatus) + + +class DaemonSetList(Model): + """ + DaemonSetList is a collection of daemon sets. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "DaemonSetList") + + items = ListField(DaemonSet) + metadata = Field(ListMeta) + + +class AllowedHostPath(Model): + """ + defines the host volume conditions that will be enabled by a policy for pods to + use. It requires the path prefix to be defined. + """ + + pathPrefix = Field(six.text_type) + + +class AllowedFlexVolume(Model): + """ + AllowedFlexVolume represents a single Flexvolume that is allowed to be used. + """ + + driver = RequiredField(six.text_type) + + +class PodSecurityPolicySpec(Model): + """ + Pod Security Policy Spec defines the policy enforced. + """ + + allowPrivilegeEscalation = Field(bool) + allowedCapabilities = ListField(six.text_type) + allowedFlexVolumes = ListField(AllowedFlexVolume) + allowedHostPaths = ListField(AllowedHostPath) + defaultAddCapabilities = ListField(six.text_type) + defaultAllowPrivilegeEscalation = Field(bool) + fsGroup = RequiredField(FSGroupStrategyOptions) + hostIPC = Field(bool) + hostNetwork = Field(bool) + hostPID = Field(bool) + hostPorts = ListField(HostPortRange) + privileged = Field(bool) + readOnlyRootFilesystem = Field(bool) + requiredDropCapabilities = ListField(six.text_type) + runAsUser = RequiredField(RunAsUserStrategyOptions) + seLinux = RequiredField(SELinuxStrategyOptions) + supplementalGroups = RequiredField(SupplementalGroupsStrategyOptions) + volumes = ListField(six.text_type) + + +class PodSecurityPolicy(Model): + """ + Pod Security Policy governs the ability to make requests that affect the + Security Context that will be applied to a pod and container. + """ + class Meta: + create_url = "/apis/extensions/v1beta1/podsecuritypolicies" + delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + get_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + list_all_url = "/apis/extensions/v1beta1/podsecuritypolicies" + update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" + watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" + watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" + + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicy") + + metadata = Field(ObjectMeta) + spec = Field(PodSecurityPolicySpec) + + +class PodSecurityPolicyList(Model): + """ + Pod Security Policy List is a list of PodSecurityPolicy objects. + """ + apiVersion = Field(six.text_type, "extensions/v1beta1") + kind = Field(six.text_type, "PodSecurityPolicyList") + + items = ListField(PodSecurityPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/networking/__init__.py b/k8s/models/v1_9/api/networking/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/networking/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/networking/v1.py b/k8s/models/v1_9/api/networking/v1.py new file mode 100644 index 0000000..56e80bb --- /dev/null +++ b/k8s/models/v1_9/api/networking/v1.py @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class NetworkPolicyPort(Model): + """ + NetworkPolicyPort describes a port to allow traffic on + """ + + port = Field(six.text_type, alt_type=int) + protocol = Field(six.text_type) + + +class IPBlock(Model): + """ + IPBlock describes a particular CIDR (Ex. '192.168.1.1/24') that is allowed to + the pods matched by a NetworkPolicySpec's podSelector. The except entry + describes CIDRs that should not be included within this rule. + """ + + _except = ListField(six.text_type) + cidr = RequiredField(six.text_type) + + +class NetworkPolicyPeer(Model): + """ + NetworkPolicyPeer describes a peer to allow traffic from. Exactly one of its + fields must be specified. + """ + + ipBlock = Field(IPBlock) + namespaceSelector = Field(LabelSelector) + podSelector = Field(LabelSelector) + + +class NetworkPolicyIngressRule(Model): + """ + NetworkPolicyIngressRule describes a particular set of traffic that is allowed + to the pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and from. + """ + + _from = ListField(NetworkPolicyPeer) + ports = ListField(NetworkPolicyPort) + + +class NetworkPolicyEgressRule(Model): + """ + NetworkPolicyEgressRule describes a particular set of traffic that is allowed + out of pods matched by a NetworkPolicySpec's podSelector. The traffic must + match both ports and to. This type is beta-level in 1.8 + """ + + ports = ListField(NetworkPolicyPort) + to = ListField(NetworkPolicyPeer) + + +class NetworkPolicySpec(Model): + """ + NetworkPolicySpec provides the specification of a NetworkPolicy + """ + + egress = ListField(NetworkPolicyEgressRule) + ingress = ListField(NetworkPolicyIngressRule) + podSelector = RequiredField(LabelSelector) + policyTypes = ListField(six.text_type) + + +class NetworkPolicy(Model): + """ + NetworkPolicy describes what network traffic is allowed for a set of Pods + """ + class Meta: + create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + get_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + list_all_url = "/apis/networking.k8s.io/v1/networkpolicies" + list_ns_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" + update_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" + watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" + watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" + watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" + + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicy") + + metadata = Field(ObjectMeta) + spec = Field(NetworkPolicySpec) + + +class NetworkPolicyList(Model): + """ + NetworkPolicyList is a list of NetworkPolicy objects. + """ + apiVersion = Field(six.text_type, "networking.k8s.io/v1") + kind = Field(six.text_type, "NetworkPolicyList") + + items = ListField(NetworkPolicy) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/policy/__init__.py b/k8s/models/v1_9/api/policy/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/policy/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/policy/v1beta1.py b/k8s/models/v1_9/api/policy/v1beta1.py new file mode 100644 index 0000000..8240fe4 --- /dev/null +++ b/k8s/models/v1_9/api/policy/v1beta1.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import DeleteOptions, LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodDisruptionBudgetStatus(Model): + """ + PodDisruptionBudgetStatus represents information about the status of a + PodDisruptionBudget. Status may trail the actual state of a system. + """ + + currentHealthy = RequiredField(int) + desiredHealthy = RequiredField(int) + disruptedPods = RequiredField(dict) + disruptionsAllowed = RequiredField(int) + expectedPods = RequiredField(int) + observedGeneration = Field(int) + + +class PodDisruptionBudgetSpec(Model): + """ + PodDisruptionBudgetSpec is a description of a PodDisruptionBudget. + """ + + maxUnavailable = Field(six.text_type, alt_type=int) + minAvailable = Field(six.text_type, alt_type=int) + selector = Field(LabelSelector) + + +class PodDisruptionBudget(Model): + """ + PodDisruptionBudget is an object to define the max disruption that can be + caused to a collection of pods + """ + class Meta: + create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + get_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + list_all_url = "/apis/policy/v1beta1/poddisruptionbudgets" + list_ns_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" + update_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" + watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" + watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" + watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudget") + + metadata = Field(ObjectMeta) + spec = Field(PodDisruptionBudgetSpec) + status = Field(PodDisruptionBudgetStatus) + + +class PodDisruptionBudgetList(Model): + """ + PodDisruptionBudgetList is a collection of PodDisruptionBudgets. + """ + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "PodDisruptionBudgetList") + + items = ListField(PodDisruptionBudget) + metadata = Field(ListMeta) + + +class Eviction(Model): + """ + Eviction evicts a pod from its node subject to certain policies and safety + constraints. This is a subresource of Pod. A request to cause such an eviction + is created by POSTing to .../pods//evictions. + """ + class Meta: + create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" + + apiVersion = Field(six.text_type, "policy/v1beta1") + kind = Field(six.text_type, "Eviction") + + deleteOptions = Field(DeleteOptions) + metadata = Field(ObjectMeta) + diff --git a/k8s/models/v1_9/api/rbac/__init__.py b/k8s/models/v1_9/api/rbac/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/rbac/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/rbac/v1.py b/k8s/models/v1_9/api/rbac/v1.py new file mode 100644 index 0000000..7b83ca9 --- /dev/null +++ b/k8s/models/v1_9/api/rbac/v1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/rbac/v1alpha1.py b/k8s/models/v1_9/api/rbac/v1alpha1.py new file mode 100644 index 0000000..35b3d09 --- /dev/null +++ b/k8s/models/v1_9/api/rbac/v1alpha1.py @@ -0,0 +1,200 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/rbac/v1beta1.py b/k8s/models/v1_9/api/rbac/v1beta1.py new file mode 100644 index 0000000..df7db11 --- /dev/null +++ b/k8s/models/v1_9/api/rbac/v1beta1.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Subject(Model): + """ + Subject contains a reference to the object or user identities a role binding + applies to. This can either hold a direct API object reference, or a value for + non-objects such as user and group names. + """ + + apiGroup = Field(six.text_type) + name = RequiredField(six.text_type) + namespace = Field(six.text_type) + + +class RoleRef(Model): + """ + RoleRef contains information that points to the role being used + """ + + apiGroup = RequiredField(six.text_type) + name = RequiredField(six.text_type) + + +class RoleBinding(Model): + """ + RoleBinding references a role, but does not contain it. It can reference a + Role in the same namespace or a ClusterRole in the global namespace. It adds + who information via Subjects and namespace information by which namespace it + exists in. RoleBindings in a given namespace only have effect in that + namespace. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/rolebindings" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class RoleBindingList(Model): + """ + RoleBindingList is a collection of RoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleBindingList") + + items = ListField(RoleBinding) + metadata = Field(ListMeta) + + +class ClusterRoleBinding(Model): + """ + ClusterRoleBinding references a ClusterRole, but not contain it. It can + reference a ClusterRole in the global namespace, and adds who information via + Subject. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBinding") + + metadata = Field(ObjectMeta) + roleRef = RequiredField(RoleRef) + subjects = ListField(Subject) + + +class ClusterRoleBindingList(Model): + """ + ClusterRoleBindingList is a collection of ClusterRoleBindings + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleBindingList") + + items = ListField(ClusterRoleBinding) + metadata = Field(ListMeta) + + +class PolicyRule(Model): + """ + PolicyRule holds information that describes a policy rule, but does not contain + information about who the rule applies to or which namespace the rule applies + to. + """ + + apiGroups = ListField(six.text_type) + nonResourceURLs = ListField(six.text_type) + resourceNames = ListField(six.text_type) + resources = ListField(six.text_type) + verbs = ListField(six.text_type) + + +class Role(Model): + """ + Role is a namespaced, logical grouping of PolicyRules that can be referenced as + a unit by a RoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/roles" + list_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" + watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "Role") + + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class RoleList(Model): + """ + RoleList is a collection of Roles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "RoleList") + + items = ListField(Role) + metadata = Field(ListMeta) + + +class AggregationRule(Model): + """ + AggregationRule describes how to locate ClusterRoles to aggregate into the + ClusterRole + """ + + clusterRoleSelectors = ListField(LabelSelector) + + +class ClusterRole(Model): + """ + ClusterRole is a cluster level, logical grouping of PolicyRules that can be + referenced as a unit by a RoleBinding or ClusterRoleBinding. + """ + class Meta: + create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + get_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + list_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" + update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" + watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" + watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" + + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRole") + + aggregationRule = Field(AggregationRule) + metadata = Field(ObjectMeta) + rules = ListField(PolicyRule) + + +class ClusterRoleList(Model): + """ + ClusterRoleList is a collection of ClusterRoles + """ + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") + kind = Field(six.text_type, "ClusterRoleList") + + items = ListField(ClusterRole) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/scheduling/__init__.py b/k8s/models/v1_9/api/scheduling/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/scheduling/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/scheduling/v1alpha1.py b/k8s/models/v1_9/api/scheduling/v1alpha1.py new file mode 100644 index 0000000..bc34b8d --- /dev/null +++ b/k8s/models/v1_9/api/scheduling/v1alpha1.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PriorityClass(Model): + """ + PriorityClass defines mapping from a priority class name to the priority + integer value. The value can be any valid integer. + """ + class Meta: + create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + get_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + list_all_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" + update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" + watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" + watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" + + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClass") + + description = Field(six.text_type) + globalDefault = Field(bool) + metadata = Field(ObjectMeta) + value = RequiredField(int) + + +class PriorityClassList(Model): + """ + PriorityClassList is a collection of priority classes. + """ + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") + kind = Field(six.text_type, "PriorityClassList") + + items = ListField(PriorityClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/settings/__init__.py b/k8s/models/v1_9/api/settings/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/settings/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/settings/v1alpha1.py b/k8s/models/v1_9/api/settings/v1alpha1.py new file mode 100644 index 0000000..5434bcb --- /dev/null +++ b/k8s/models/v1_9/api/settings/v1alpha1.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField +from k8s.models.v1_9.api.core.v1 import EnvFromSource, EnvVar, Volume, VolumeMount +from k8s.models.v1_9.apimachinery.apis.meta.v1 import LabelSelector, ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class PodPresetSpec(Model): + """ + PodPresetSpec is a description of a pod preset. + """ + + env = ListField(EnvVar) + envFrom = ListField(EnvFromSource) + selector = Field(LabelSelector) + volumeMounts = ListField(VolumeMount) + volumes = ListField(Volume) + + +class PodPreset(Model): + """ + PodPreset is a policy resource that defines additional runtime requirements for + a Pod. + """ + class Meta: + create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + get_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + list_all_url = "/apis/settings.k8s.io/v1alpha1/podpresets" + list_ns_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" + update_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" + watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" + watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" + watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" + + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPreset") + + metadata = Field(ObjectMeta) + spec = Field(PodPresetSpec) + + +class PodPresetList(Model): + """ + PodPresetList is a list of PodPreset objects. + """ + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") + kind = Field(six.text_type, "PodPresetList") + + items = ListField(PodPreset) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/storage/__init__.py b/k8s/models/v1_9/api/storage/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/api/storage/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/api/storage/v1.py b/k8s/models/v1_9/api/storage/v1.py new file mode 100644 index 0000000..5d51b0c --- /dev/null +++ b/k8s/models/v1_9/api/storage/v1.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1/storageclasses" + update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/storage/v1alpha1.py b/k8s/models/v1_9/api/storage/v1alpha1.py new file mode 100644 index 0000000..8141a20 --- /dev/null +++ b/k8s/models/v1_9/api/storage/v1alpha1.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class VolumeError(Model): + """ + VolumeError captures an error encountered during a volume operation. + """ + + message = Field(six.text_type) + time = Field(datetime.datetime) + + +class VolumeAttachmentStatus(Model): + """ + VolumeAttachmentStatus is the status of a VolumeAttachment request. + """ + + attachError = Field(VolumeError) + attached = RequiredField(bool) + attachmentMetadata = Field(dict) + detachError = Field(VolumeError) + + +class VolumeAttachmentSource(Model): + """ + VolumeAttachmentSource represents a volume that should be attached. Right now + only PersistenVolumes can be attached via external attacher, in future we may + allow also inline volumes in pods. Exactly one member can be set. + """ + + persistentVolumeName = Field(six.text_type) + + +class VolumeAttachmentSpec(Model): + """ + VolumeAttachmentSpec is the specification of a VolumeAttachment request. + """ + + attacher = RequiredField(six.text_type) + nodeName = RequiredField(six.text_type) + source = RequiredField(VolumeAttachmentSource) + + +class VolumeAttachment(Model): + """ + VolumeAttachment captures the intent to attach or detach the specified volume + to/from the specified node. + + VolumeAttachment objects are non-namespaced. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + get_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + list_all_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" + update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" + watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachment") + + metadata = Field(ObjectMeta) + spec = RequiredField(VolumeAttachmentSpec) + status = Field(VolumeAttachmentStatus) + + +class VolumeAttachmentList(Model): + """ + VolumeAttachmentList is a collection of VolumeAttachment objects. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") + kind = Field(six.text_type, "VolumeAttachmentList") + + items = ListField(VolumeAttachment) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/api/storage/v1beta1.py b/k8s/models/v1_9/api/storage/v1beta1.py new file mode 100644 index 0000000..b155af2 --- /dev/null +++ b/k8s/models/v1_9/api/storage/v1beta1.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class StorageClass(Model): + """ + StorageClass describes the parameters for a class of storage for which + PersistentVolumes can be dynamically provisioned. + + StorageClasses are non- + namespaced; the name of the storage class according to etcd is in + ObjectMeta.Name. + """ + class Meta: + create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + get_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + list_all_url = "/apis/storage.k8s.io/v1beta1/storageclasses" + update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" + watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" + watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" + + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClass") + + allowVolumeExpansion = Field(bool) + metadata = Field(ObjectMeta) + mountOptions = ListField(six.text_type) + parameters = Field(dict) + provisioner = RequiredField(six.text_type) + reclaimPolicy = Field(six.text_type) + volumeBindingMode = Field(six.text_type) + + +class StorageClassList(Model): + """ + StorageClassList is a collection of storage classes. + """ + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") + kind = Field(six.text_type, "StorageClassList") + + items = ListField(StorageClass) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/apiextensions_apiserver/__init__.py b/k8s/models/v1_9/apiextensions_apiserver/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apiextensions_apiserver/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apiextensions_apiserver/apis/__init__.py b/k8s/models/v1_9/apiextensions_apiserver/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apiextensions_apiserver/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/__init__.py b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py new file mode 100644 index 0000000..ffc2b10 --- /dev/null +++ b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ExternalDocumentation(Model): + """ + ExternalDocumentation allows referencing an external resource for extended + documentation. + """ + + description = Field(six.text_type) + url = Field(six.text_type) + + +class CustomResourceValidation(Model): + """ + CustomResourceValidation is a list of validation methods for CustomResources. + """ + + openAPIV3Schema = Field(dict) + + +class CustomResourceDefinitionNames(Model): + """ + CustomResourceDefinitionNames indicates the names to serve this + CustomResourceDefinition + """ + + listKind = Field(six.text_type) + plural = RequiredField(six.text_type) + shortNames = ListField(six.text_type) + singular = Field(six.text_type) + + +class CustomResourceDefinitionSpec(Model): + """ + CustomResourceDefinitionSpec describes how a user wants their resource to + appear + """ + + group = RequiredField(six.text_type) + names = RequiredField(CustomResourceDefinitionNames) + scope = RequiredField(six.text_type) + validation = Field(CustomResourceValidation) + version = RequiredField(six.text_type) + + +class CustomResourceDefinitionCondition(Model): + """ + CustomResourceDefinitionCondition contains details for the current condition of + this pod. + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class CustomResourceDefinitionStatus(Model): + """ + CustomResourceDefinitionStatus indicates the state of the + CustomResourceDefinition + """ + + acceptedNames = RequiredField(CustomResourceDefinitionNames) + conditions = ListField(CustomResourceDefinitionCondition) + + +class CustomResourceDefinition(Model): + """ + CustomResourceDefinition represents a resource that should be exposed on the + API server. Its name MUST be in the format <.spec.name>.<.spec.group>. + """ + class Meta: + create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + get_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + list_all_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" + update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" + watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" + watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" + + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinition") + + metadata = Field(ObjectMeta) + spec = Field(CustomResourceDefinitionSpec) + status = Field(CustomResourceDefinitionStatus) + + +class CustomResourceDefinitionList(Model): + """ + CustomResourceDefinitionList is a list of CustomResourceDefinition objects. + """ + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") + kind = Field(six.text_type, "CustomResourceDefinitionList") + + items = ListField(CustomResourceDefinition) + metadata = Field(ListMeta) + diff --git a/k8s/models/v1_9/apimachinery/__init__.py b/k8s/models/v1_9/apimachinery/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apimachinery/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apimachinery/apis/__init__.py b/k8s/models/v1_9/apimachinery/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apimachinery/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apimachinery/apis/meta/__init__.py b/k8s/models/v1_9/apimachinery/apis/meta/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/apimachinery/apis/meta/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/apimachinery/apis/meta/v1.py b/k8s/models/v1_9/apimachinery/apis/meta/v1.py new file mode 100644 index 0000000..4c71480 --- /dev/null +++ b/k8s/models/v1_9/apimachinery/apis/meta/v1.py @@ -0,0 +1,268 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, ReadOnlyField, RequiredField +from k8s.models.v1_9.apimachinery.runtime import RawExtension + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class WatchEvent(Model): + """ + Event represents a single event to a watched resource. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "WatchEvent") + + object = RequiredField(RawExtension) + type = RequiredField(six.text_type) + + +class StatusCause(Model): + """ + StatusCause provides more information about an api.Status failure, including + cases when multiple errors are encountered. + """ + + field = Field(six.text_type) + message = Field(six.text_type) + reason = Field(six.text_type) + + +class StatusDetails(Model): + """ + StatusDetails is a set of additional properties that MAY be set by the server + to provide additional information about a response. The Reason field of a + Status object defines what attributes will be set. Clients must ignore fields + that do not match the defined type of each attribute, and should assume that + any attribute may be empty, invalid, or under defined. + """ + + causes = ListField(StatusCause) + group = Field(six.text_type) + name = Field(six.text_type) + retryAfterSeconds = Field(int) + uid = Field(six.text_type) + + +class ServerAddressByClientCIDR(Model): + """ + ServerAddressByClientCIDR helps the client to determine the server address that + they should use, depending on the clientCIDR that they match. + """ + + clientCIDR = RequiredField(six.text_type) + serverAddress = RequiredField(six.text_type) + + +class APIVersions(Model): + """ + APIVersions lists the versions that are available, to allow clients to discover + the API at /api, which is the root path of the legacy v1 API. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIVersions") + + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(six.text_type) + + +class Preconditions(Model): + """ + Preconditions must be fulfilled before an operation (update, delete, etc.) is + carried out. + """ + + uid = Field(six.text_type) + + +class DeleteOptions(Model): + """ + DeleteOptions may be provided when deleting an API object. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "DeleteOptions") + + gracePeriodSeconds = Field(int) + orphanDependents = Field(bool) + preconditions = Field(Preconditions) + propagationPolicy = Field(six.text_type) + + +class OwnerReference(Model): + """ + OwnerReference contains enough information to let you identify an owning + object. Currently, an owning object must be in the same namespace, so there is + no namespace field. + """ + + blockOwnerDeletion = Field(bool) + controller = Field(bool) + name = RequiredField(six.text_type) + uid = RequiredField(six.text_type) + + +class ListMeta(Model): + """ + ListMeta describes metadata that synthetic resources must have, including lists + and various status objects. A resource may have only one of {ObjectMeta, + ListMeta}. + """ + + _continue = Field(six.text_type) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + + +class Status(Model): + """ + Status is a return value for calls that don't return other objects. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "Status") + + code = Field(int) + details = Field(StatusDetails) + message = Field(six.text_type) + metadata = Field(ListMeta) + reason = Field(six.text_type) + status = Field(six.text_type) + + +class LabelSelectorRequirement(Model): + """ + A label selector requirement is a selector that contains values, a key, and an + operator that relates the key and values. + """ + + key = RequiredField(six.text_type) + operator = RequiredField(six.text_type) + values = ListField(six.text_type) + + +class LabelSelector(Model): + """ + A label selector is a label query over a set of resources. The result of + matchLabels and matchExpressions are ANDed. An empty label selector matches all + objects. A null label selector matches no objects. + """ + + matchExpressions = ListField(LabelSelectorRequirement) + matchLabels = Field(dict) + + +class Initializer(Model): + """ + Initializer is information about an initializer that has not yet completed. + """ + + name = RequiredField(six.text_type) + + +class Initializers(Model): + """ + Initializers tracks the progress of initialization. + """ + + pending = ListField(Initializer) + result = Field(Status) + + +class ObjectMeta(Model): + """ + ObjectMeta is metadata that all persisted resources must have, which includes + all objects users must create. + """ + + annotations = Field(dict) + clusterName = Field(six.text_type) + creationTimestamp = ReadOnlyField(datetime.datetime) + deletionGracePeriodSeconds = ReadOnlyField(int) + deletionTimestamp = ReadOnlyField(datetime.datetime) + finalizers = ListField(six.text_type) + generateName = Field(six.text_type) + generation = ReadOnlyField(int) + initializers = Field(Initializers) + labels = Field(dict) + name = Field(six.text_type) + namespace = Field(six.text_type) + ownerReferences = ListField(OwnerReference) + resourceVersion = ReadOnlyField(six.text_type) + selfLink = ReadOnlyField(six.text_type) + uid = ReadOnlyField(six.text_type) + + +class GroupVersionForDiscovery(Model): + """ + GroupVersion contains the 'group/version' and 'version' string of a version. It + is made a struct to keep extensibility. + """ + + groupVersion = RequiredField(six.text_type) + version = RequiredField(six.text_type) + + +class APIGroup(Model): + """ + APIGroup contains the name, the supported versions, and the preferred version + of a group. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroup") + + name = RequiredField(six.text_type) + preferredVersion = Field(GroupVersionForDiscovery) + serverAddressByClientCIDRs = ListField(ServerAddressByClientCIDR) + versions = ListField(GroupVersionForDiscovery) + + +class APIGroupList(Model): + """ + APIGroupList is a list of APIGroup, to allow clients to discover the API at + /apis. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIGroupList") + + groups = ListField(APIGroup) + + +class APIResource(Model): + """ + APIResource specifies the name of a resource and whether it is namespaced. + """ + + categories = ListField(six.text_type) + group = Field(six.text_type) + name = RequiredField(six.text_type) + namespaced = RequiredField(bool) + shortNames = ListField(six.text_type) + singularName = RequiredField(six.text_type) + verbs = ListField(six.text_type) + version = Field(six.text_type) + + +class APIResourceList(Model): + """ + APIResourceList is a list of APIResource, it is used to expose the name of the + resources supported in a specific group and version, and if the resource is + namespaced. + """ + apiVersion = Field(six.text_type, "v1") + kind = Field(six.text_type, "APIResourceList") + + groupVersion = RequiredField(six.text_type) + resources = ListField(APIResource) + diff --git a/k8s/models/v1_9/apimachinery/runtime.py b/k8s/models/v1_9/apimachinery/runtime.py new file mode 100644 index 0000000..e483edb --- /dev/null +++ b/k8s/models/v1_9/apimachinery/runtime.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class RawExtension(Model): + """ + RawExtension is used to hold extensions in external versions. + + To use this, + make a field which has RawExtension as its type in your external, versioned + struct, and Object in your internal struct. You also need to register your + various plugin types. + + // Internal package: type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin runtime.Object `json:'myPlugin'` + } + type PluginA struct { + AOption string `json:'aOption'` + } + + // External package: + type MyAPIObject struct { + runtime.TypeMeta `json:',inline'` + MyPlugin + runtime.RawExtension `json:'myPlugin'` + } type PluginA struct { + AOption string + `json:'aOption'` + } + + // On the wire, the JSON will look something like this: { + 'kind':'MyAPIObject', + 'apiVersion':'v1', + 'myPlugin': { + 'kind':'PluginA', + 'aOption':'foo', + }, + } + + So what happens? Decode first uses json or yaml to + unmarshal the serialized data into your external MyAPIObject. That causes the + raw JSON to be stored, but not unpacked. The next step is to copy (using + pkg/conversion) into the internal struct. The runtime package's DefaultScheme + has conversion functions installed which will unpack the JSON stored in + RawExtension, turning it into the correct object type, and storing it in the + Object. (TODO: In the case where the object is of an unknown type, a + runtime.Unknown object will be created and stored.) + """ + + Raw = RequiredField(six.text_type) + diff --git a/k8s/models/v1_9/apimachinery/version.py b/k8s/models/v1_9/apimachinery/version.py new file mode 100644 index 0000000..522b6b7 --- /dev/null +++ b/k8s/models/v1_9/apimachinery/version.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import six + +from k8s.base import Model +from k8s.fields import RequiredField + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class Info(Model): + """ + Info contains versioning information. how we'll want to distribute that + information. + """ + + buildDate = RequiredField(six.text_type) + compiler = RequiredField(six.text_type) + gitCommit = RequiredField(six.text_type) + gitTreeState = RequiredField(six.text_type) + gitVersion = RequiredField(six.text_type) + goVersion = RequiredField(six.text_type) + major = RequiredField(six.text_type) + minor = RequiredField(six.text_type) + platform = RequiredField(six.text_type) + diff --git a/k8s/models/v1_9/kube_aggregator/__init__.py b/k8s/models/v1_9/kube_aggregator/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/kube_aggregator/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/kube_aggregator/apis/__init__.py b/k8s/models/v1_9/kube_aggregator/apis/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/kube_aggregator/apis/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/kube_aggregator/apis/apiregistration/__init__.py b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/__init__.py new file mode 100644 index 0000000..3048693 --- /dev/null +++ b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/__init__.py @@ -0,0 +1 @@ +# Generated file \ No newline at end of file diff --git a/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py new file mode 100644 index 0000000..0a47379 --- /dev/null +++ b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py @@ -0,0 +1,98 @@ +#!/usr/bin/env python +# -*- coding: utf-8 +from __future__ import absolute_import + +import datetime + +import six + +from k8s.base import Model +from k8s.fields import Field, ListField, RequiredField +from k8s.models.v1_9.apimachinery.apis.meta.v1 import ListMeta, ObjectMeta + + +############################################################################### +# This file is auto-generated! Do not edit! +# +# Codestyle checking is disabled for this file +# flake8: noqa +############################################################################### + + +class ServiceReference(Model): + """ + ServiceReference holds a reference to Service.legacy.k8s.io + """ + + name = Field(six.text_type) + namespace = Field(six.text_type) + + +class APIServiceSpec(Model): + """ + APIServiceSpec contains information for locating and communicating with a + server. Only https is supported, though you are able to disable certificate + verification. + """ + + caBundle = RequiredField(six.text_type) + group = Field(six.text_type) + groupPriorityMinimum = RequiredField(int) + insecureSkipTLSVerify = Field(bool) + service = RequiredField(ServiceReference) + version = Field(six.text_type) + versionPriority = RequiredField(int) + + +class APIServiceCondition(Model): + """ + + """ + + lastTransitionTime = Field(datetime.datetime) + message = Field(six.text_type) + reason = Field(six.text_type) + status = RequiredField(six.text_type) + type = RequiredField(six.text_type) + + +class APIServiceStatus(Model): + """ + APIServiceStatus contains derived information about an API server + """ + + conditions = ListField(APIServiceCondition) + + +class APIService(Model): + """ + APIService represents a server for a particular GroupVersion. Name must be + 'version.group'. + """ + class Meta: + create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + get_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + list_all_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" + update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" + watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" + watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" + + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIService") + + metadata = Field(ObjectMeta) + spec = Field(APIServiceSpec) + status = Field(APIServiceStatus) + + +class APIServiceList(Model): + """ + APIServiceList is a list of APIService objects. + """ + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") + kind = Field(six.text_type, "APIServiceList") + + items = ListField(APIService) + metadata = Field(ListMeta) + From af950351cac38d9e6cdd9c5cc1913e1ba6c35e92 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Thu, 10 Jan 2019 10:35:21 +0100 Subject: [PATCH 22/25] Clean up generated code --- bin/model.jinja2 | 6 +-- .../api/admissionregistration/v1alpha1.py | 4 +- .../api/admissionregistration/v1beta1.py | 7 +-- k8s/models/v1_10/api/apps/v1.py | 16 +++--- k8s/models/v1_10/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_10/api/apps/v1beta2.py | 16 +++--- k8s/models/v1_10/api/authentication/v1.py | 4 +- .../v1_10/api/authentication/v1beta1.py | 4 +- k8s/models/v1_10/api/authorization/v1.py | 13 +++-- k8s/models/v1_10/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_10/api/autoscaling/v1.py | 4 +- k8s/models/v1_10/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_10/api/batch/v1.py | 4 +- k8s/models/v1_10/api/batch/v1beta1.py | 4 +- k8s/models/v1_10/api/batch/v2alpha1.py | 4 +- k8s/models/v1_10/api/certificates/v1beta1.py | 4 +- k8s/models/v1_10/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_10/api/events/v1beta1.py | 4 +- k8s/models/v1_10/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_10/api/networking/v1.py | 4 +- k8s/models/v1_10/api/policy/v1beta1.py | 10 ++-- k8s/models/v1_10/api/rbac/v1.py | 13 +++-- k8s/models/v1_10/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_10/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_10/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_10/api/settings/v1alpha1.py | 4 +- k8s/models/v1_10/api/storage/v1.py | 4 +- k8s/models/v1_10/api/storage/v1alpha1.py | 4 +- k8s/models/v1_10/api/storage/v1beta1.py | 7 +-- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_10/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_10/apimachinery/runtime.py | 1 - k8s/models/v1_10/apimachinery/version.py | 1 - .../apis/apiregistration/v1.py | 4 +- .../apis/apiregistration/v1beta1.py | 4 +- .../api/admissionregistration/v1alpha1.py | 4 +- .../api/admissionregistration/v1beta1.py | 7 +-- k8s/models/v1_11/api/apps/v1.py | 16 +++--- k8s/models/v1_11/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_11/api/apps/v1beta2.py | 16 +++--- k8s/models/v1_11/api/authentication/v1.py | 4 +- .../v1_11/api/authentication/v1beta1.py | 4 +- k8s/models/v1_11/api/authorization/v1.py | 13 +++-- k8s/models/v1_11/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_11/api/autoscaling/v1.py | 4 +- k8s/models/v1_11/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_11/api/batch/v1.py | 4 +- k8s/models/v1_11/api/batch/v1beta1.py | 4 +- k8s/models/v1_11/api/batch/v2alpha1.py | 4 +- k8s/models/v1_11/api/certificates/v1beta1.py | 4 +- k8s/models/v1_11/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_11/api/events/v1beta1.py | 4 +- k8s/models/v1_11/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_11/api/networking/v1.py | 4 +- k8s/models/v1_11/api/policy/v1beta1.py | 10 ++-- k8s/models/v1_11/api/rbac/v1.py | 13 +++-- k8s/models/v1_11/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_11/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_11/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_11/api/scheduling/v1beta1.py | 4 +- k8s/models/v1_11/api/settings/v1alpha1.py | 4 +- k8s/models/v1_11/api/storage/v1.py | 4 +- k8s/models/v1_11/api/storage/v1alpha1.py | 4 +- k8s/models/v1_11/api/storage/v1beta1.py | 7 +-- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_11/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_11/apimachinery/runtime.py | 1 - k8s/models/v1_11/apimachinery/version.py | 1 - .../apis/apiregistration/v1.py | 4 +- .../apis/apiregistration/v1beta1.py | 4 +- .../api/admissionregistration/v1alpha1.py | 4 +- .../api/admissionregistration/v1beta1.py | 7 +-- k8s/models/v1_12/api/apps/v1.py | 16 +++--- k8s/models/v1_12/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_12/api/apps/v1beta2.py | 16 +++--- k8s/models/v1_12/api/authentication/v1.py | 4 +- .../v1_12/api/authentication/v1beta1.py | 4 +- k8s/models/v1_12/api/authorization/v1.py | 13 +++-- k8s/models/v1_12/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_12/api/autoscaling/v1.py | 4 +- k8s/models/v1_12/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_12/api/autoscaling/v2beta2.py | 4 +- k8s/models/v1_12/api/batch/v1.py | 4 +- k8s/models/v1_12/api/batch/v1beta1.py | 4 +- k8s/models/v1_12/api/batch/v2alpha1.py | 4 +- k8s/models/v1_12/api/certificates/v1beta1.py | 4 +- k8s/models/v1_12/api/coordination/v1beta1.py | 4 +- k8s/models/v1_12/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_12/api/events/v1beta1.py | 4 +- k8s/models/v1_12/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_12/api/networking/v1.py | 4 +- k8s/models/v1_12/api/policy/v1beta1.py | 10 ++-- k8s/models/v1_12/api/rbac/v1.py | 13 +++-- k8s/models/v1_12/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_12/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_12/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_12/api/scheduling/v1beta1.py | 4 +- k8s/models/v1_12/api/settings/v1alpha1.py | 4 +- k8s/models/v1_12/api/storage/v1.py | 4 +- k8s/models/v1_12/api/storage/v1alpha1.py | 4 +- k8s/models/v1_12/api/storage/v1beta1.py | 7 +-- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_12/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_12/apimachinery/runtime.py | 1 - k8s/models/v1_12/apimachinery/version.py | 1 - .../apis/apiregistration/v1.py | 4 +- .../apis/apiregistration/v1beta1.py | 4 +- .../api/admissionregistration/v1alpha1.py | 4 +- .../api/admissionregistration/v1beta1.py | 7 +-- k8s/models/v1_13/api/apps/v1.py | 16 +++--- k8s/models/v1_13/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_13/api/apps/v1beta2.py | 16 +++--- .../v1_13/api/auditregistration/v1alpha1.py | 4 +- k8s/models/v1_13/api/authentication/v1.py | 4 +- .../v1_13/api/authentication/v1beta1.py | 4 +- k8s/models/v1_13/api/authorization/v1.py | 13 +++-- k8s/models/v1_13/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_13/api/autoscaling/v1.py | 4 +- k8s/models/v1_13/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_13/api/autoscaling/v2beta2.py | 4 +- k8s/models/v1_13/api/batch/v1.py | 4 +- k8s/models/v1_13/api/batch/v1beta1.py | 4 +- k8s/models/v1_13/api/batch/v2alpha1.py | 4 +- k8s/models/v1_13/api/certificates/v1beta1.py | 4 +- k8s/models/v1_13/api/coordination/v1beta1.py | 4 +- k8s/models/v1_13/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_13/api/events/v1beta1.py | 4 +- k8s/models/v1_13/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_13/api/networking/v1.py | 4 +- k8s/models/v1_13/api/policy/v1beta1.py | 10 ++-- k8s/models/v1_13/api/rbac/v1.py | 13 +++-- k8s/models/v1_13/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_13/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_13/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_13/api/scheduling/v1beta1.py | 4 +- k8s/models/v1_13/api/settings/v1alpha1.py | 4 +- k8s/models/v1_13/api/storage/v1.py | 7 +-- k8s/models/v1_13/api/storage/v1alpha1.py | 4 +- k8s/models/v1_13/api/storage/v1beta1.py | 7 +-- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_13/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_13/apimachinery/runtime.py | 1 - k8s/models/v1_13/apimachinery/version.py | 1 - .../apis/apiregistration/v1.py | 4 +- .../apis/apiregistration/v1beta1.py | 4 +- k8s/models/v1_6/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_6/apimachinery/runtime.py | 1 - k8s/models/v1_6/apimachinery/version.py | 1 - k8s/models/v1_6/kubernetes/api/v1.py | 49 +++++++++++------ .../v1_6/kubernetes/apis/apps/v1beta1.py | 7 +-- .../v1_6/kubernetes/apis/authentication/v1.py | 4 +- .../kubernetes/apis/authentication/v1beta1.py | 4 +- .../v1_6/kubernetes/apis/authorization/v1.py | 10 ++-- .../kubernetes/apis/authorization/v1beta1.py | 10 ++-- .../v1_6/kubernetes/apis/autoscaling/v1.py | 4 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 4 +- k8s/models/v1_6/kubernetes/apis/batch/v1.py | 4 +- .../v1_6/kubernetes/apis/batch/v2alpha1.py | 4 +- .../kubernetes/apis/certificates/v1beta1.py | 4 +- .../kubernetes/apis/extensions/v1beta1.py | 22 +++++--- .../v1_6/kubernetes/apis/policy/v1beta1.py | 4 +- .../v1_6/kubernetes/apis/rbac/v1alpha1.py | 13 +++-- .../v1_6/kubernetes/apis/rbac/v1beta1.py | 13 +++-- .../v1_6/kubernetes/apis/settings/v1alpha1.py | 4 +- k8s/models/v1_6/kubernetes/apis/storage/v1.py | 4 +- .../v1_6/kubernetes/apis/storage/v1beta1.py | 4 +- k8s/models/v1_7/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_7/apimachinery/runtime.py | 1 - k8s/models/v1_7/apimachinery/version.py | 1 - .../apis/apiregistration/v1beta1.py | 4 +- k8s/models/v1_7/kubernetes/api/v1.py | 52 ++++++++++++------- .../apis/admissionregistration/v1alpha1.py | 7 +-- .../v1_7/kubernetes/apis/apps/v1beta1.py | 10 ++-- .../v1_7/kubernetes/apis/authentication/v1.py | 4 +- .../kubernetes/apis/authentication/v1beta1.py | 4 +- .../v1_7/kubernetes/apis/authorization/v1.py | 10 ++-- .../kubernetes/apis/authorization/v1beta1.py | 10 ++-- .../v1_7/kubernetes/apis/autoscaling/v1.py | 4 +- .../kubernetes/apis/autoscaling/v2alpha1.py | 4 +- k8s/models/v1_7/kubernetes/apis/batch/v1.py | 4 +- .../v1_7/kubernetes/apis/batch/v2alpha1.py | 4 +- .../kubernetes/apis/certificates/v1beta1.py | 4 +- .../kubernetes/apis/extensions/v1beta1.py | 22 +++++--- .../v1_7/kubernetes/apis/networking/v1.py | 4 +- .../v1_7/kubernetes/apis/policy/v1beta1.py | 7 +-- .../v1_7/kubernetes/apis/rbac/v1alpha1.py | 13 +++-- .../v1_7/kubernetes/apis/rbac/v1beta1.py | 13 +++-- .../v1_7/kubernetes/apis/settings/v1alpha1.py | 4 +- k8s/models/v1_7/kubernetes/apis/storage/v1.py | 4 +- .../v1_7/kubernetes/apis/storage/v1beta1.py | 4 +- .../api/admissionregistration/v1alpha1.py | 7 +-- k8s/models/v1_8/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_8/api/apps/v1beta2.py | 16 +++--- k8s/models/v1_8/api/authentication/v1.py | 4 +- k8s/models/v1_8/api/authentication/v1beta1.py | 4 +- k8s/models/v1_8/api/authorization/v1.py | 13 +++-- k8s/models/v1_8/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_8/api/autoscaling/v1.py | 4 +- k8s/models/v1_8/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_8/api/batch/v1.py | 4 +- k8s/models/v1_8/api/batch/v1beta1.py | 4 +- k8s/models/v1_8/api/batch/v2alpha1.py | 4 +- k8s/models/v1_8/api/certificates/v1beta1.py | 4 +- k8s/models/v1_8/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_8/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_8/api/networking/v1.py | 4 +- k8s/models/v1_8/api/policy/v1beta1.py | 7 +-- k8s/models/v1_8/api/rbac/v1.py | 13 +++-- k8s/models/v1_8/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_8/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_8/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_8/api/settings/v1alpha1.py | 4 +- k8s/models/v1_8/api/storage/v1.py | 4 +- k8s/models/v1_8/api/storage/v1beta1.py | 4 +- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_8/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_8/apimachinery/runtime.py | 1 - k8s/models/v1_8/apimachinery/version.py | 1 - .../apis/apiregistration/v1beta1.py | 4 +- .../api/admissionregistration/v1alpha1.py | 4 +- .../v1_9/api/admissionregistration/v1beta1.py | 7 +-- k8s/models/v1_9/api/apps/v1.py | 16 +++--- k8s/models/v1_9/api/apps/v1beta1.py | 10 ++-- k8s/models/v1_9/api/apps/v1beta2.py | 16 +++--- k8s/models/v1_9/api/authentication/v1.py | 4 +- k8s/models/v1_9/api/authentication/v1beta1.py | 4 +- k8s/models/v1_9/api/authorization/v1.py | 13 +++-- k8s/models/v1_9/api/authorization/v1beta1.py | 13 +++-- k8s/models/v1_9/api/autoscaling/v1.py | 4 +- k8s/models/v1_9/api/autoscaling/v2beta1.py | 4 +- k8s/models/v1_9/api/batch/v1.py | 4 +- k8s/models/v1_9/api/batch/v1beta1.py | 4 +- k8s/models/v1_9/api/batch/v2alpha1.py | 4 +- k8s/models/v1_9/api/certificates/v1beta1.py | 4 +- k8s/models/v1_9/api/core/v1.py | 52 ++++++++++++------- k8s/models/v1_9/api/events/v1beta1.py | 4 +- k8s/models/v1_9/api/extensions/v1beta1.py | 19 ++++--- k8s/models/v1_9/api/networking/v1.py | 4 +- k8s/models/v1_9/api/policy/v1beta1.py | 7 +-- k8s/models/v1_9/api/rbac/v1.py | 13 +++-- k8s/models/v1_9/api/rbac/v1alpha1.py | 13 +++-- k8s/models/v1_9/api/rbac/v1beta1.py | 13 +++-- k8s/models/v1_9/api/scheduling/v1alpha1.py | 4 +- k8s/models/v1_9/api/settings/v1alpha1.py | 4 +- k8s/models/v1_9/api/storage/v1.py | 4 +- k8s/models/v1_9/api/storage/v1alpha1.py | 4 +- k8s/models/v1_9/api/storage/v1beta1.py | 4 +- .../apis/apiextensions/v1beta1.py | 4 +- k8s/models/v1_9/apimachinery/apis/meta/v1.py | 1 - k8s/models/v1_9/apimachinery/runtime.py | 1 - k8s/models/v1_9/apimachinery/version.py | 1 - .../apis/apiregistration/v1beta1.py | 4 +- 252 files changed, 1179 insertions(+), 842 deletions(-) diff --git a/bin/model.jinja2 b/bin/model.jinja2 index 79702fb..c063c8b 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -17,19 +17,20 @@ from k8s.fields import Field, ListField, ReadOnlyField, RequiredField {% for import in module.imports %} from k8s.models.{{ version }}.{{ import.module.ref }} import {{ import.names|join(", ") }} {% endfor %} - {% for model in module.models %} + class {{ model.definition.name }}(Model): """ {{ model.definition.description|replace('"', '\'')|wordwrap|indent }} """ {% if model.operations %} + class Meta: {% for operation in model.operations %} {{ operation.action }}_url = "{{ operation.path }}" {% endfor %} - + {% endif %} {% if model.definition.gvks %} {% set gvk = model.definition.gvks[-1] %} @@ -42,5 +43,4 @@ class {{ model.definition.name }}(Model): {% else %} # Model has no fields {% endfor %} - {% endfor %} diff --git a/k8s/models/v1_10/api/admissionregistration/v1alpha1.py b/k8s/models/v1_10/api/admissionregistration/v1alpha1.py index e055896..dac393f 100644 --- a/k8s/models/v1_10/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_10/api/admissionregistration/v1alpha1.py @@ -42,6 +42,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -50,7 +51,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -67,4 +68,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/admissionregistration/v1beta1.py b/k8s/models/v1_10/api/admissionregistration/v1beta1.py index c9b1c5c..0a58f15 100644 --- a/k8s/models/v1_10/api/admissionregistration/v1beta1.py +++ b/k8s/models/v1_10/api/admissionregistration/v1beta1.py @@ -68,6 +68,7 @@ class ValidatingWebhookConfiguration(Model): ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" @@ -76,7 +77,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "ValidatingWebhookConfiguration") @@ -100,6 +101,7 @@ class MutatingWebhookConfiguration(Model): MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" @@ -108,7 +110,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "MutatingWebhookConfiguration") @@ -125,4 +127,3 @@ class MutatingWebhookConfigurationList(Model): items = ListField(MutatingWebhookConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/apps/v1.py b/k8s/models/v1_10/api/apps/v1.py index 9ad9f88..8690fe8 100644 --- a/k8s/models/v1_10/api/apps/v1.py +++ b/k8s/models/v1_10/api/apps/v1.py @@ -94,6 +94,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" @@ -104,7 +105,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "StatefulSet") @@ -228,6 +229,7 @@ class ReplicaSet(Model): ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" @@ -238,7 +240,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1/watch/replicasets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ReplicaSet") @@ -290,6 +292,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" @@ -300,7 +303,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1/watch/deployments" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "Deployment") @@ -353,6 +356,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" @@ -363,7 +367,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "DaemonSet") @@ -395,6 +399,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" @@ -405,7 +410,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ControllerRevision") @@ -424,4 +429,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/apps/v1beta1.py b/k8s/models/v1_10/api/apps/v1beta1.py index 13e5ac4..ae7a906 100644 --- a/k8s/models/v1_10/api/apps/v1beta1.py +++ b/k8s/models/v1_10/api/apps/v1beta1.py @@ -126,6 +126,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -136,7 +137,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -245,6 +246,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -255,7 +257,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -289,6 +291,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -299,7 +302,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -318,4 +321,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/apps/v1beta2.py b/k8s/models/v1_10/api/apps/v1beta2.py index abe1693..fa78a4d 100644 --- a/k8s/models/v1_10/api/apps/v1beta2.py +++ b/k8s/models/v1_10/api/apps/v1beta2.py @@ -125,6 +125,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -135,7 +136,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -260,6 +261,7 @@ class ReplicaSet(Model): apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -270,7 +272,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -324,6 +326,7 @@ class Deployment(Model): apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -334,7 +337,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -389,6 +392,7 @@ class DaemonSet(Model): apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -399,7 +403,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -433,6 +437,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -443,7 +448,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -462,4 +467,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/authentication/v1.py b/k8s/models/v1_10/api/authentication/v1.py index 0e3efd4..ca65877 100644 --- a/k8s/models/v1_10/api/authentication/v1.py +++ b/k8s/models/v1_10/api/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_10/api/authentication/v1beta1.py b/k8s/models/v1_10/api/authentication/v1beta1.py index 231f332..43680cc 100644 --- a/k8s/models/v1_10/api/authentication/v1beta1.py +++ b/k8s/models/v1_10/api/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_10/api/authorization/v1.py b/k8s/models/v1_10/api/authorization/v1.py index 7f49689..9812f33 100644 --- a/k8s/models/v1_10/api/authorization/v1.py +++ b/k8s/models/v1_10/api/authorization/v1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_10/api/authorization/v1beta1.py b/k8s/models/v1_10/api/authorization/v1beta1.py index 3709624..3b3dabd 100644 --- a/k8s/models/v1_10/api/authorization/v1beta1.py +++ b/k8s/models/v1_10/api/authorization/v1beta1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_10/api/autoscaling/v1.py b/k8s/models/v1_10/api/autoscaling/v1.py index 8377528..cbe3c62 100644 --- a/k8s/models/v1_10/api/autoscaling/v1.py +++ b/k8s/models/v1_10/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/autoscaling/v2beta1.py b/k8s/models/v1_10/api/autoscaling/v2beta1.py index 81439ae..bcead4d 100644 --- a/k8s/models/v1_10/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_10/api/autoscaling/v2beta1.py @@ -197,6 +197,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -207,7 +208,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -225,4 +226,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/batch/v1.py b/k8s/models/v1_10/api/batch/v1.py index 62fd5f6..5b94fa2 100644 --- a/k8s/models/v1_10/api/batch/v1.py +++ b/k8s/models/v1_10/api/batch/v1.py @@ -64,6 +64,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -74,7 +75,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -92,4 +93,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/batch/v1beta1.py b/k8s/models/v1_10/api/batch/v1beta1.py index bdcf072..a142454 100644 --- a/k8s/models/v1_10/api/batch/v1beta1.py +++ b/k8s/models/v1_10/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/batch/v2alpha1.py b/k8s/models/v1_10/api/batch/v2alpha1.py index 3441db0..6fcf603 100644 --- a/k8s/models/v1_10/api/batch/v2alpha1.py +++ b/k8s/models/v1_10/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/certificates/v1beta1.py b/k8s/models/v1_10/api/certificates/v1beta1.py index 866be0c..93bd6dc 100644 --- a/k8s/models/v1_10/api/certificates/v1beta1.py +++ b/k8s/models/v1_10/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/core/v1.py b/k8s/models/v1_10/api/core/v1.py index 4e5e9d4..cf8e5c8 100644 --- a/k8s/models/v1_10/api/core/v1.py +++ b/k8s/models/v1_10/api/core/v1.py @@ -229,6 +229,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -239,7 +240,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -332,6 +333,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -342,7 +344,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -557,6 +559,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -567,7 +570,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -653,9 +656,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -829,6 +833,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -837,7 +842,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -903,6 +908,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -913,7 +919,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -1065,6 +1071,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -1075,7 +1082,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1362,6 +1369,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1372,7 +1380,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1455,6 +1463,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1465,7 +1474,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1666,6 +1675,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1676,7 +1686,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1711,10 +1721,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1778,6 +1789,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1788,7 +1800,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -1943,6 +1955,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -1951,7 +1964,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -2082,6 +2095,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -2092,7 +2106,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -2116,6 +2130,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -2126,7 +2141,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2150,6 +2165,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2160,7 +2176,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2223,6 +2239,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2231,7 +2248,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2249,4 +2266,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/events/v1beta1.py b/k8s/models/v1_10/api/events/v1beta1.py index 34a78d3..d60dcab 100644 --- a/k8s/models/v1_10/api/events/v1beta1.py +++ b/k8s/models/v1_10/api/events/v1beta1.py @@ -36,6 +36,7 @@ class Event(Model): Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. """ + class Meta: create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" @@ -46,7 +47,7 @@ class Meta: watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") kind = Field(six.text_type, "Event") @@ -76,4 +77,3 @@ class EventList(Model): items = ListField(Event) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/extensions/v1beta1.py b/k8s/models/v1_10/api/extensions/v1beta1.py index f3852d5..2e9d350 100644 --- a/k8s/models/v1_10/api/extensions/v1beta1.py +++ b/k8s/models/v1_10/api/extensions/v1beta1.py @@ -187,6 +187,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -197,7 +198,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -303,6 +304,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -313,7 +315,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -399,6 +401,7 @@ class NetworkPolicy(Model): networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -409,7 +412,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -513,6 +516,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -523,7 +527,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -578,6 +582,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -588,7 +593,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -655,6 +660,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -663,7 +669,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -680,4 +686,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/networking/v1.py b/k8s/models/v1_10/api/networking/v1.py index 07dc2dc..7e6b1f6 100644 --- a/k8s/models/v1_10/api/networking/v1.py +++ b/k8s/models/v1_10/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/policy/v1beta1.py b/k8s/models/v1_10/api/policy/v1beta1.py index 3e96035..743bfa0 100644 --- a/k8s/models/v1_10/api/policy/v1beta1.py +++ b/k8s/models/v1_10/api/policy/v1beta1.py @@ -57,6 +57,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -67,7 +68,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -142,9 +143,10 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") @@ -199,6 +201,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/policy/v1beta1/podsecuritypolicies" delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" @@ -207,7 +210,7 @@ class Meta: update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -224,4 +227,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/rbac/v1.py b/k8s/models/v1_10/api/rbac/v1.py index f149e91..1febf86 100644 --- a/k8s/models/v1_10/api/rbac/v1.py +++ b/k8s/models/v1_10/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/rbac/v1alpha1.py b/k8s/models/v1_10/api/rbac/v1alpha1.py index 439426f..8b0b9ce 100644 --- a/k8s/models/v1_10/api/rbac/v1alpha1.py +++ b/k8s/models/v1_10/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -171,6 +174,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -179,7 +183,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -197,4 +201,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/rbac/v1beta1.py b/k8s/models/v1_10/api/rbac/v1beta1.py index f9a8586..1bb38b1 100644 --- a/k8s/models/v1_10/api/rbac/v1beta1.py +++ b/k8s/models/v1_10/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/scheduling/v1alpha1.py b/k8s/models/v1_10/api/scheduling/v1alpha1.py index 518984f..8dbb3c5 100644 --- a/k8s/models/v1_10/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_10/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/settings/v1alpha1.py b/k8s/models/v1_10/api/settings/v1alpha1.py index 2c6e322..48138ac 100644 --- a/k8s/models/v1_10/api/settings/v1alpha1.py +++ b/k8s/models/v1_10/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/storage/v1.py b/k8s/models/v1_10/api/storage/v1.py index 7b78a8e..696ef15 100644 --- a/k8s/models/v1_10/api/storage/v1.py +++ b/k8s/models/v1_10/api/storage/v1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -56,4 +57,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/storage/v1alpha1.py b/k8s/models/v1_10/api/storage/v1alpha1.py index aba5149..94f50ce 100644 --- a/k8s/models/v1_10/api/storage/v1alpha1.py +++ b/k8s/models/v1_10/api/storage/v1alpha1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") kind = Field(six.text_type, "VolumeAttachment") @@ -92,4 +93,3 @@ class VolumeAttachmentList(Model): items = ListField(VolumeAttachment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/api/storage/v1beta1.py b/k8s/models/v1_10/api/storage/v1beta1.py index 4763319..478bb8c 100644 --- a/k8s/models/v1_10/api/storage/v1beta1.py +++ b/k8s/models/v1_10/api/storage/v1beta1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "VolumeAttachment") @@ -103,6 +104,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -111,7 +113,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -133,4 +135,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 50e3e88..0277302 100644 --- a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -113,6 +113,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -121,7 +122,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -139,4 +140,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/apimachinery/apis/meta/v1.py b/k8s/models/v1_10/apimachinery/apis/meta/v1.py index 1c5a5a1..96585d6 100644 --- a/k8s/models/v1_10/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_10/apimachinery/apis/meta/v1.py @@ -265,4 +265,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_10/apimachinery/runtime.py b/k8s/models/v1_10/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_10/apimachinery/runtime.py +++ b/k8s/models/v1_10/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_10/apimachinery/version.py b/k8s/models/v1_10/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_10/apimachinery/version.py +++ b/k8s/models/v1_10/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py index 054fa7b..2487893 100644 --- a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py +++ b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py index 7cbe5e6..63a86d7 100644 --- a/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_10/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/admissionregistration/v1alpha1.py b/k8s/models/v1_11/api/admissionregistration/v1alpha1.py index e18c37f..09e47ea 100644 --- a/k8s/models/v1_11/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_11/api/admissionregistration/v1alpha1.py @@ -42,6 +42,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -50,7 +51,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -67,4 +68,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/admissionregistration/v1beta1.py b/k8s/models/v1_11/api/admissionregistration/v1beta1.py index 846ae8f..2f475df 100644 --- a/k8s/models/v1_11/api/admissionregistration/v1beta1.py +++ b/k8s/models/v1_11/api/admissionregistration/v1beta1.py @@ -68,6 +68,7 @@ class ValidatingWebhookConfiguration(Model): ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" @@ -76,7 +77,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "ValidatingWebhookConfiguration") @@ -100,6 +101,7 @@ class MutatingWebhookConfiguration(Model): MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" @@ -108,7 +110,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "MutatingWebhookConfiguration") @@ -125,4 +127,3 @@ class MutatingWebhookConfigurationList(Model): items = ListField(MutatingWebhookConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/apps/v1.py b/k8s/models/v1_11/api/apps/v1.py index 3a0fdd1..68b20dc 100644 --- a/k8s/models/v1_11/api/apps/v1.py +++ b/k8s/models/v1_11/api/apps/v1.py @@ -94,6 +94,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" @@ -104,7 +105,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "StatefulSet") @@ -228,6 +229,7 @@ class ReplicaSet(Model): ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" @@ -238,7 +240,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1/watch/replicasets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ReplicaSet") @@ -290,6 +292,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" @@ -300,7 +303,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1/watch/deployments" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "Deployment") @@ -353,6 +356,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" @@ -363,7 +367,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "DaemonSet") @@ -395,6 +399,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" @@ -405,7 +410,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ControllerRevision") @@ -424,4 +429,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/apps/v1beta1.py b/k8s/models/v1_11/api/apps/v1beta1.py index d4c2090..efe0424 100644 --- a/k8s/models/v1_11/api/apps/v1beta1.py +++ b/k8s/models/v1_11/api/apps/v1beta1.py @@ -126,6 +126,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -136,7 +137,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -245,6 +246,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -255,7 +257,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -289,6 +291,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -299,7 +302,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -318,4 +321,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/apps/v1beta2.py b/k8s/models/v1_11/api/apps/v1beta2.py index 1bc22d0..3cab163 100644 --- a/k8s/models/v1_11/api/apps/v1beta2.py +++ b/k8s/models/v1_11/api/apps/v1beta2.py @@ -125,6 +125,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -135,7 +136,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -260,6 +261,7 @@ class ReplicaSet(Model): apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -270,7 +272,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -324,6 +326,7 @@ class Deployment(Model): apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -334,7 +337,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -389,6 +392,7 @@ class DaemonSet(Model): apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -399,7 +403,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -433,6 +437,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -443,7 +448,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -462,4 +467,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/authentication/v1.py b/k8s/models/v1_11/api/authentication/v1.py index 990e906..c1e628f 100644 --- a/k8s/models/v1_11/api/authentication/v1.py +++ b/k8s/models/v1_11/api/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_11/api/authentication/v1beta1.py b/k8s/models/v1_11/api/authentication/v1beta1.py index b69a521..4fb1822 100644 --- a/k8s/models/v1_11/api/authentication/v1beta1.py +++ b/k8s/models/v1_11/api/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_11/api/authorization/v1.py b/k8s/models/v1_11/api/authorization/v1.py index 9e4aaa8..8ee7fe4 100644 --- a/k8s/models/v1_11/api/authorization/v1.py +++ b/k8s/models/v1_11/api/authorization/v1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_11/api/authorization/v1beta1.py b/k8s/models/v1_11/api/authorization/v1beta1.py index e40bbe7..77f1778 100644 --- a/k8s/models/v1_11/api/authorization/v1beta1.py +++ b/k8s/models/v1_11/api/authorization/v1beta1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_11/api/autoscaling/v1.py b/k8s/models/v1_11/api/autoscaling/v1.py index 2e5d579..cf205c2 100644 --- a/k8s/models/v1_11/api/autoscaling/v1.py +++ b/k8s/models/v1_11/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/autoscaling/v2beta1.py b/k8s/models/v1_11/api/autoscaling/v2beta1.py index f0f53aa..4a148d5 100644 --- a/k8s/models/v1_11/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_11/api/autoscaling/v2beta1.py @@ -197,6 +197,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -207,7 +208,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -225,4 +226,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/batch/v1.py b/k8s/models/v1_11/api/batch/v1.py index 3404e12..10fd51b 100644 --- a/k8s/models/v1_11/api/batch/v1.py +++ b/k8s/models/v1_11/api/batch/v1.py @@ -64,6 +64,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -74,7 +75,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -92,4 +93,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/batch/v1beta1.py b/k8s/models/v1_11/api/batch/v1beta1.py index 36030bc..69b90bd 100644 --- a/k8s/models/v1_11/api/batch/v1beta1.py +++ b/k8s/models/v1_11/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/batch/v2alpha1.py b/k8s/models/v1_11/api/batch/v2alpha1.py index 58377fc..611cf07 100644 --- a/k8s/models/v1_11/api/batch/v2alpha1.py +++ b/k8s/models/v1_11/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/certificates/v1beta1.py b/k8s/models/v1_11/api/certificates/v1beta1.py index 7e1009b..576b8b5 100644 --- a/k8s/models/v1_11/api/certificates/v1beta1.py +++ b/k8s/models/v1_11/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/core/v1.py b/k8s/models/v1_11/api/core/v1.py index 211001c..d127ac8 100644 --- a/k8s/models/v1_11/api/core/v1.py +++ b/k8s/models/v1_11/api/core/v1.py @@ -286,6 +286,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -296,7 +297,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -411,6 +412,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -421,7 +423,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -644,6 +646,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -654,7 +657,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -716,9 +719,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -895,6 +899,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -903,7 +908,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -969,6 +974,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -979,7 +985,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -1145,6 +1151,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -1155,7 +1162,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1447,6 +1454,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1457,7 +1465,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1540,6 +1548,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1550,7 +1559,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1799,6 +1808,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1809,7 +1819,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1844,10 +1854,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1911,6 +1922,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1921,7 +1933,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -2064,6 +2076,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -2072,7 +2085,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -2204,6 +2217,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -2214,7 +2228,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -2238,6 +2252,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -2248,7 +2263,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2272,6 +2287,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2282,7 +2298,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2345,6 +2361,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2353,7 +2370,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2371,4 +2388,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/events/v1beta1.py b/k8s/models/v1_11/api/events/v1beta1.py index 9f714d7..3ed225a 100644 --- a/k8s/models/v1_11/api/events/v1beta1.py +++ b/k8s/models/v1_11/api/events/v1beta1.py @@ -36,6 +36,7 @@ class Event(Model): Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. """ + class Meta: create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" @@ -46,7 +47,7 @@ class Meta: watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") kind = Field(six.text_type, "Event") @@ -76,4 +77,3 @@ class EventList(Model): items = ListField(Event) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/extensions/v1beta1.py b/k8s/models/v1_11/api/extensions/v1beta1.py index 17e43f3..6194935 100644 --- a/k8s/models/v1_11/api/extensions/v1beta1.py +++ b/k8s/models/v1_11/api/extensions/v1beta1.py @@ -188,6 +188,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -198,7 +199,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -304,6 +305,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -314,7 +316,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -400,6 +402,7 @@ class NetworkPolicy(Model): networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -410,7 +413,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -518,6 +521,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -528,7 +532,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -583,6 +587,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -593,7 +598,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -667,6 +672,7 @@ class PodSecurityPolicy(Model): Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -675,7 +681,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -693,4 +699,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/networking/v1.py b/k8s/models/v1_11/api/networking/v1.py index 00bd108..fabc589 100644 --- a/k8s/models/v1_11/api/networking/v1.py +++ b/k8s/models/v1_11/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/policy/v1beta1.py b/k8s/models/v1_11/api/policy/v1beta1.py index bf6db39..537374a 100644 --- a/k8s/models/v1_11/api/policy/v1beta1.py +++ b/k8s/models/v1_11/api/policy/v1beta1.py @@ -57,6 +57,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -67,7 +68,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -142,9 +143,10 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") @@ -202,6 +204,7 @@ class PodSecurityPolicy(Model): PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/policy/v1beta1/podsecuritypolicies" delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" @@ -210,7 +213,7 @@ class Meta: update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -227,4 +230,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/rbac/v1.py b/k8s/models/v1_11/api/rbac/v1.py index 8c1df4b..73d6d20 100644 --- a/k8s/models/v1_11/api/rbac/v1.py +++ b/k8s/models/v1_11/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/rbac/v1alpha1.py b/k8s/models/v1_11/api/rbac/v1alpha1.py index a305975..dae825a 100644 --- a/k8s/models/v1_11/api/rbac/v1alpha1.py +++ b/k8s/models/v1_11/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -171,6 +174,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -179,7 +183,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -197,4 +201,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/rbac/v1beta1.py b/k8s/models/v1_11/api/rbac/v1beta1.py index ba7fcdd..a46504a 100644 --- a/k8s/models/v1_11/api/rbac/v1beta1.py +++ b/k8s/models/v1_11/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/scheduling/v1alpha1.py b/k8s/models/v1_11/api/scheduling/v1alpha1.py index 6593b64..67bda26 100644 --- a/k8s/models/v1_11/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_11/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/scheduling/v1beta1.py b/k8s/models/v1_11/api/scheduling/v1beta1.py index 0b7b9db..2f94ec6 100644 --- a/k8s/models/v1_11/api/scheduling/v1beta1.py +++ b/k8s/models/v1_11/api/scheduling/v1beta1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/settings/v1alpha1.py b/k8s/models/v1_11/api/settings/v1alpha1.py index 3c9f561..1ca59d7 100644 --- a/k8s/models/v1_11/api/settings/v1alpha1.py +++ b/k8s/models/v1_11/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/storage/v1.py b/k8s/models/v1_11/api/storage/v1.py index c9d137a..e0a6ea7 100644 --- a/k8s/models/v1_11/api/storage/v1.py +++ b/k8s/models/v1_11/api/storage/v1.py @@ -27,6 +27,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -35,7 +36,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -58,4 +59,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/storage/v1alpha1.py b/k8s/models/v1_11/api/storage/v1alpha1.py index 8e9ea28..a05b61d 100644 --- a/k8s/models/v1_11/api/storage/v1alpha1.py +++ b/k8s/models/v1_11/api/storage/v1alpha1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") kind = Field(six.text_type, "VolumeAttachment") @@ -92,4 +93,3 @@ class VolumeAttachmentList(Model): items = ListField(VolumeAttachment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/api/storage/v1beta1.py b/k8s/models/v1_11/api/storage/v1beta1.py index c00b452..f2aafb9 100644 --- a/k8s/models/v1_11/api/storage/v1beta1.py +++ b/k8s/models/v1_11/api/storage/v1beta1.py @@ -67,6 +67,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" @@ -75,7 +76,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "VolumeAttachment") @@ -104,6 +105,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -112,7 +114,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -135,4 +137,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 2c80630..57b8fb2 100644 --- a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -139,6 +139,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -147,7 +148,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -165,4 +166,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/apimachinery/apis/meta/v1.py b/k8s/models/v1_11/apimachinery/apis/meta/v1.py index b39461c..3b785ff 100644 --- a/k8s/models/v1_11/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_11/apimachinery/apis/meta/v1.py @@ -265,4 +265,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_11/apimachinery/runtime.py b/k8s/models/v1_11/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_11/apimachinery/runtime.py +++ b/k8s/models/v1_11/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_11/apimachinery/version.py b/k8s/models/v1_11/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_11/apimachinery/version.py +++ b/k8s/models/v1_11/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py index 04a1266..5adf0a5 100644 --- a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py +++ b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py index 7eadd70..950f76f 100644 --- a/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_11/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/admissionregistration/v1alpha1.py b/k8s/models/v1_12/api/admissionregistration/v1alpha1.py index c06d376..d15c68f 100644 --- a/k8s/models/v1_12/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_12/api/admissionregistration/v1alpha1.py @@ -42,6 +42,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -50,7 +51,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -67,4 +68,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/admissionregistration/v1beta1.py b/k8s/models/v1_12/api/admissionregistration/v1beta1.py index a649f6a..90b40f6 100644 --- a/k8s/models/v1_12/api/admissionregistration/v1beta1.py +++ b/k8s/models/v1_12/api/admissionregistration/v1beta1.py @@ -69,6 +69,7 @@ class ValidatingWebhookConfiguration(Model): ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "ValidatingWebhookConfiguration") @@ -101,6 +102,7 @@ class MutatingWebhookConfiguration(Model): MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" @@ -109,7 +111,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "MutatingWebhookConfiguration") @@ -126,4 +128,3 @@ class MutatingWebhookConfigurationList(Model): items = ListField(MutatingWebhookConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/apps/v1.py b/k8s/models/v1_12/api/apps/v1.py index f31531c..1fcf3eb 100644 --- a/k8s/models/v1_12/api/apps/v1.py +++ b/k8s/models/v1_12/api/apps/v1.py @@ -94,6 +94,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" @@ -104,7 +105,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "StatefulSet") @@ -228,6 +229,7 @@ class ReplicaSet(Model): ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" @@ -238,7 +240,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1/watch/replicasets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ReplicaSet") @@ -290,6 +292,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" @@ -300,7 +303,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1/watch/deployments" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "Deployment") @@ -353,6 +356,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" @@ -363,7 +367,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "DaemonSet") @@ -395,6 +399,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" @@ -405,7 +410,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ControllerRevision") @@ -424,4 +429,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/apps/v1beta1.py b/k8s/models/v1_12/api/apps/v1beta1.py index d5b6255..a9b4ea8 100644 --- a/k8s/models/v1_12/api/apps/v1beta1.py +++ b/k8s/models/v1_12/api/apps/v1beta1.py @@ -126,6 +126,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -136,7 +137,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -245,6 +246,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -255,7 +257,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -289,6 +291,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -299,7 +302,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -318,4 +321,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/apps/v1beta2.py b/k8s/models/v1_12/api/apps/v1beta2.py index 2dbd764..fffba97 100644 --- a/k8s/models/v1_12/api/apps/v1beta2.py +++ b/k8s/models/v1_12/api/apps/v1beta2.py @@ -125,6 +125,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -135,7 +136,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -260,6 +261,7 @@ class ReplicaSet(Model): apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -270,7 +272,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -324,6 +326,7 @@ class Deployment(Model): apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -334,7 +337,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -389,6 +392,7 @@ class DaemonSet(Model): apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -399,7 +403,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -433,6 +437,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -443,7 +448,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -462,4 +467,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/authentication/v1.py b/k8s/models/v1_12/api/authentication/v1.py index 1085ddb..17acaba 100644 --- a/k8s/models/v1_12/api/authentication/v1.py +++ b/k8s/models/v1_12/api/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_12/api/authentication/v1beta1.py b/k8s/models/v1_12/api/authentication/v1beta1.py index 1c91850..b74a671 100644 --- a/k8s/models/v1_12/api/authentication/v1beta1.py +++ b/k8s/models/v1_12/api/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_12/api/authorization/v1.py b/k8s/models/v1_12/api/authorization/v1.py index 00af195..3f16d29 100644 --- a/k8s/models/v1_12/api/authorization/v1.py +++ b/k8s/models/v1_12/api/authorization/v1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_12/api/authorization/v1beta1.py b/k8s/models/v1_12/api/authorization/v1beta1.py index 8085551..bcd4d9a 100644 --- a/k8s/models/v1_12/api/authorization/v1beta1.py +++ b/k8s/models/v1_12/api/authorization/v1beta1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_12/api/autoscaling/v1.py b/k8s/models/v1_12/api/autoscaling/v1.py index 653f1a3..76bfa16 100644 --- a/k8s/models/v1_12/api/autoscaling/v1.py +++ b/k8s/models/v1_12/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/autoscaling/v2beta1.py b/k8s/models/v1_12/api/autoscaling/v2beta1.py index a532d5f..03d9ca4 100644 --- a/k8s/models/v1_12/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_12/api/autoscaling/v2beta1.py @@ -203,6 +203,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -213,7 +214,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -231,4 +232,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/autoscaling/v2beta2.py b/k8s/models/v1_12/api/autoscaling/v2beta2.py index 76f74d7..a698d6f 100644 --- a/k8s/models/v1_12/api/autoscaling/v2beta2.py +++ b/k8s/models/v1_12/api/autoscaling/v2beta2.py @@ -221,6 +221,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -231,7 +232,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta2") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -249,4 +250,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/batch/v1.py b/k8s/models/v1_12/api/batch/v1.py index ad963f4..0e17ea9 100644 --- a/k8s/models/v1_12/api/batch/v1.py +++ b/k8s/models/v1_12/api/batch/v1.py @@ -65,6 +65,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -75,7 +76,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -93,4 +94,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/batch/v1beta1.py b/k8s/models/v1_12/api/batch/v1beta1.py index 2d79f66..70d8a12 100644 --- a/k8s/models/v1_12/api/batch/v1beta1.py +++ b/k8s/models/v1_12/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/batch/v2alpha1.py b/k8s/models/v1_12/api/batch/v2alpha1.py index a787439..eb58b31 100644 --- a/k8s/models/v1_12/api/batch/v2alpha1.py +++ b/k8s/models/v1_12/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/certificates/v1beta1.py b/k8s/models/v1_12/api/certificates/v1beta1.py index 205e69e..d6070f7 100644 --- a/k8s/models/v1_12/api/certificates/v1beta1.py +++ b/k8s/models/v1_12/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/coordination/v1beta1.py b/k8s/models/v1_12/api/coordination/v1beta1.py index 427bc05..7a69639 100644 --- a/k8s/models/v1_12/api/coordination/v1beta1.py +++ b/k8s/models/v1_12/api/coordination/v1beta1.py @@ -35,6 +35,7 @@ class Lease(Model): """ Lease defines a lease concept. """ + class Meta: create_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" delete_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases/{name}" watchlist_all_url = "/apis/coordination.k8s.io/v1beta1/watch/leases" watchlist_ns_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases" - + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") kind = Field(six.text_type, "Lease") @@ -62,4 +63,3 @@ class LeaseList(Model): items = ListField(Lease) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/core/v1.py b/k8s/models/v1_12/api/core/v1.py index b53c83c..a38b899 100644 --- a/k8s/models/v1_12/api/core/v1.py +++ b/k8s/models/v1_12/api/core/v1.py @@ -296,6 +296,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -306,7 +307,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -422,6 +423,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -432,7 +434,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -655,6 +657,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -665,7 +668,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -727,9 +730,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -906,6 +910,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -914,7 +919,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -981,6 +986,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -991,7 +997,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -1157,6 +1163,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -1167,7 +1174,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1459,6 +1466,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1469,7 +1477,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1552,6 +1560,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1562,7 +1571,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1811,6 +1820,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1821,7 +1831,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1856,10 +1866,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1923,6 +1934,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1933,7 +1945,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -2077,6 +2089,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -2085,7 +2098,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -2218,6 +2231,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -2228,7 +2242,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -2252,6 +2266,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -2262,7 +2277,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2286,6 +2301,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2296,7 +2312,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2359,6 +2375,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2367,7 +2384,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2385,4 +2402,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/events/v1beta1.py b/k8s/models/v1_12/api/events/v1beta1.py index 2a2dd64..126921e 100644 --- a/k8s/models/v1_12/api/events/v1beta1.py +++ b/k8s/models/v1_12/api/events/v1beta1.py @@ -36,6 +36,7 @@ class Event(Model): Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. """ + class Meta: create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" @@ -46,7 +47,7 @@ class Meta: watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") kind = Field(six.text_type, "Event") @@ -76,4 +77,3 @@ class EventList(Model): items = ListField(Event) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/extensions/v1beta1.py b/k8s/models/v1_12/api/extensions/v1beta1.py index 12e86e7..bb378d4 100644 --- a/k8s/models/v1_12/api/extensions/v1beta1.py +++ b/k8s/models/v1_12/api/extensions/v1beta1.py @@ -188,6 +188,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -198,7 +199,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -304,6 +305,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -314,7 +316,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -400,6 +402,7 @@ class NetworkPolicy(Model): networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -410,7 +413,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -518,6 +521,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -528,7 +532,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -583,6 +587,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -593,7 +598,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -668,6 +673,7 @@ class PodSecurityPolicy(Model): Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -676,7 +682,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -694,4 +700,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/networking/v1.py b/k8s/models/v1_12/api/networking/v1.py index e37e8c9..7c895fc 100644 --- a/k8s/models/v1_12/api/networking/v1.py +++ b/k8s/models/v1_12/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/policy/v1beta1.py b/k8s/models/v1_12/api/policy/v1beta1.py index 65d4b52..e7e5259 100644 --- a/k8s/models/v1_12/api/policy/v1beta1.py +++ b/k8s/models/v1_12/api/policy/v1beta1.py @@ -57,6 +57,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -67,7 +68,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -142,9 +143,10 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") @@ -203,6 +205,7 @@ class PodSecurityPolicy(Model): PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/policy/v1beta1/podsecuritypolicies" delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" @@ -211,7 +214,7 @@ class Meta: update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -228,4 +231,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/rbac/v1.py b/k8s/models/v1_12/api/rbac/v1.py index 384c68f..c2a4c47 100644 --- a/k8s/models/v1_12/api/rbac/v1.py +++ b/k8s/models/v1_12/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/rbac/v1alpha1.py b/k8s/models/v1_12/api/rbac/v1alpha1.py index 7afa16a..b0ab132 100644 --- a/k8s/models/v1_12/api/rbac/v1alpha1.py +++ b/k8s/models/v1_12/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -171,6 +174,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -179,7 +183,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -197,4 +201,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/rbac/v1beta1.py b/k8s/models/v1_12/api/rbac/v1beta1.py index 678aabb..b580ab1 100644 --- a/k8s/models/v1_12/api/rbac/v1beta1.py +++ b/k8s/models/v1_12/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/scheduling/v1alpha1.py b/k8s/models/v1_12/api/scheduling/v1alpha1.py index 2cda012..6eb6c70 100644 --- a/k8s/models/v1_12/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_12/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/scheduling/v1beta1.py b/k8s/models/v1_12/api/scheduling/v1beta1.py index 7a8e0d4..7c47b20 100644 --- a/k8s/models/v1_12/api/scheduling/v1beta1.py +++ b/k8s/models/v1_12/api/scheduling/v1beta1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/settings/v1alpha1.py b/k8s/models/v1_12/api/settings/v1alpha1.py index 30bbda4..1f3f799 100644 --- a/k8s/models/v1_12/api/settings/v1alpha1.py +++ b/k8s/models/v1_12/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/storage/v1.py b/k8s/models/v1_12/api/storage/v1.py index 9be2e91..acec50a 100644 --- a/k8s/models/v1_12/api/storage/v1.py +++ b/k8s/models/v1_12/api/storage/v1.py @@ -27,6 +27,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -35,7 +36,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -58,4 +59,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/storage/v1alpha1.py b/k8s/models/v1_12/api/storage/v1alpha1.py index 4d4b1cc..2066e55 100644 --- a/k8s/models/v1_12/api/storage/v1alpha1.py +++ b/k8s/models/v1_12/api/storage/v1alpha1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") kind = Field(six.text_type, "VolumeAttachment") @@ -92,4 +93,3 @@ class VolumeAttachmentList(Model): items = ListField(VolumeAttachment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/api/storage/v1beta1.py b/k8s/models/v1_12/api/storage/v1beta1.py index f1e1269..baf7590 100644 --- a/k8s/models/v1_12/api/storage/v1beta1.py +++ b/k8s/models/v1_12/api/storage/v1beta1.py @@ -67,6 +67,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" @@ -75,7 +76,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "VolumeAttachment") @@ -104,6 +105,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -112,7 +114,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -135,4 +137,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 0b599bc..ad4b5a8 100644 --- a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -139,6 +139,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -147,7 +148,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -165,4 +166,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/apimachinery/apis/meta/v1.py b/k8s/models/v1_12/apimachinery/apis/meta/v1.py index 4dcc21d..2e812bd 100644 --- a/k8s/models/v1_12/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_12/apimachinery/apis/meta/v1.py @@ -266,4 +266,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_12/apimachinery/runtime.py b/k8s/models/v1_12/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_12/apimachinery/runtime.py +++ b/k8s/models/v1_12/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_12/apimachinery/version.py b/k8s/models/v1_12/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_12/apimachinery/version.py +++ b/k8s/models/v1_12/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py index 3699208..40dd18a 100644 --- a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py +++ b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py index c376094..687bc12 100644 --- a/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_12/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/admissionregistration/v1alpha1.py b/k8s/models/v1_13/api/admissionregistration/v1alpha1.py index a9fae38..6ebd2fb 100644 --- a/k8s/models/v1_13/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_13/api/admissionregistration/v1alpha1.py @@ -42,6 +42,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -50,7 +51,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -67,4 +68,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/admissionregistration/v1beta1.py b/k8s/models/v1_13/api/admissionregistration/v1beta1.py index 7390ac3..8b75c2b 100644 --- a/k8s/models/v1_13/api/admissionregistration/v1beta1.py +++ b/k8s/models/v1_13/api/admissionregistration/v1beta1.py @@ -69,6 +69,7 @@ class ValidatingWebhookConfiguration(Model): ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "ValidatingWebhookConfiguration") @@ -101,6 +102,7 @@ class MutatingWebhookConfiguration(Model): MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" @@ -109,7 +111,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "MutatingWebhookConfiguration") @@ -126,4 +128,3 @@ class MutatingWebhookConfigurationList(Model): items = ListField(MutatingWebhookConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/apps/v1.py b/k8s/models/v1_13/api/apps/v1.py index 091872b..832ed28 100644 --- a/k8s/models/v1_13/api/apps/v1.py +++ b/k8s/models/v1_13/api/apps/v1.py @@ -94,6 +94,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" @@ -104,7 +105,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "StatefulSet") @@ -228,6 +229,7 @@ class ReplicaSet(Model): ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" @@ -238,7 +240,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1/watch/replicasets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ReplicaSet") @@ -290,6 +292,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" @@ -300,7 +303,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1/watch/deployments" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "Deployment") @@ -353,6 +356,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" @@ -363,7 +367,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "DaemonSet") @@ -395,6 +399,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" @@ -405,7 +410,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ControllerRevision") @@ -424,4 +429,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/apps/v1beta1.py b/k8s/models/v1_13/api/apps/v1beta1.py index 830cea2..2d16c52 100644 --- a/k8s/models/v1_13/api/apps/v1beta1.py +++ b/k8s/models/v1_13/api/apps/v1beta1.py @@ -126,6 +126,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -136,7 +137,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -245,6 +246,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -255,7 +257,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -289,6 +291,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -299,7 +302,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -318,4 +321,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/apps/v1beta2.py b/k8s/models/v1_13/api/apps/v1beta2.py index 73be75d..b2ca56f 100644 --- a/k8s/models/v1_13/api/apps/v1beta2.py +++ b/k8s/models/v1_13/api/apps/v1beta2.py @@ -125,6 +125,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -135,7 +136,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -260,6 +261,7 @@ class ReplicaSet(Model): apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -270,7 +272,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -324,6 +326,7 @@ class Deployment(Model): apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -334,7 +337,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -389,6 +392,7 @@ class DaemonSet(Model): apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -399,7 +403,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -433,6 +437,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -443,7 +448,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -462,4 +467,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/auditregistration/v1alpha1.py b/k8s/models/v1_13/api/auditregistration/v1alpha1.py index 3437968..fedaf16 100644 --- a/k8s/models/v1_13/api/auditregistration/v1alpha1.py +++ b/k8s/models/v1_13/api/auditregistration/v1alpha1.py @@ -78,6 +78,7 @@ class AuditSink(Model): """ AuditSink represents a cluster level audit sink """ + class Meta: create_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks" delete_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}" @@ -86,7 +87,7 @@ class Meta: update_url = "/apis/auditregistration.k8s.io/v1alpha1/auditsinks/{name}" watch_url = "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks/{name}" watchlist_all_url = "/apis/auditregistration.k8s.io/v1alpha1/watch/auditsinks" - + apiVersion = Field(six.text_type, "auditregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "AuditSink") @@ -103,4 +104,3 @@ class AuditSinkList(Model): items = ListField(AuditSink) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/authentication/v1.py b/k8s/models/v1_13/api/authentication/v1.py index 364da80..bfb1ec7 100644 --- a/k8s/models/v1_13/api/authentication/v1.py +++ b/k8s/models/v1_13/api/authentication/v1.py @@ -55,13 +55,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_13/api/authentication/v1beta1.py b/k8s/models/v1_13/api/authentication/v1beta1.py index 1d1ee59..6699e90 100644 --- a/k8s/models/v1_13/api/authentication/v1beta1.py +++ b/k8s/models/v1_13/api/authentication/v1beta1.py @@ -55,13 +55,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_13/api/authorization/v1.py b/k8s/models/v1_13/api/authorization/v1.py index 96d49dc..d98fc74 100644 --- a/k8s/models/v1_13/api/authorization/v1.py +++ b/k8s/models/v1_13/api/authorization/v1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_13/api/authorization/v1beta1.py b/k8s/models/v1_13/api/authorization/v1beta1.py index f53bac4..1806640 100644 --- a/k8s/models/v1_13/api/authorization/v1beta1.py +++ b/k8s/models/v1_13/api/authorization/v1beta1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_13/api/autoscaling/v1.py b/k8s/models/v1_13/api/autoscaling/v1.py index da5ceae..d8b3bc8 100644 --- a/k8s/models/v1_13/api/autoscaling/v1.py +++ b/k8s/models/v1_13/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/autoscaling/v2beta1.py b/k8s/models/v1_13/api/autoscaling/v2beta1.py index ed36d2f..559df2e 100644 --- a/k8s/models/v1_13/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_13/api/autoscaling/v2beta1.py @@ -203,6 +203,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -213,7 +214,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -231,4 +232,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/autoscaling/v2beta2.py b/k8s/models/v1_13/api/autoscaling/v2beta2.py index 9dbdb0f..f710b62 100644 --- a/k8s/models/v1_13/api/autoscaling/v2beta2.py +++ b/k8s/models/v1_13/api/autoscaling/v2beta2.py @@ -221,6 +221,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -231,7 +232,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta2/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta2/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta2") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -249,4 +250,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/batch/v1.py b/k8s/models/v1_13/api/batch/v1.py index eae1cf9..b725d8c 100644 --- a/k8s/models/v1_13/api/batch/v1.py +++ b/k8s/models/v1_13/api/batch/v1.py @@ -65,6 +65,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -75,7 +76,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -93,4 +94,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/batch/v1beta1.py b/k8s/models/v1_13/api/batch/v1beta1.py index 22ebffb..58ce11d 100644 --- a/k8s/models/v1_13/api/batch/v1beta1.py +++ b/k8s/models/v1_13/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/batch/v2alpha1.py b/k8s/models/v1_13/api/batch/v2alpha1.py index ab5f01d..e6cdec3 100644 --- a/k8s/models/v1_13/api/batch/v2alpha1.py +++ b/k8s/models/v1_13/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/certificates/v1beta1.py b/k8s/models/v1_13/api/certificates/v1beta1.py index 7d83ea5..6769206 100644 --- a/k8s/models/v1_13/api/certificates/v1beta1.py +++ b/k8s/models/v1_13/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/coordination/v1beta1.py b/k8s/models/v1_13/api/coordination/v1beta1.py index aecabb5..fdfa8fc 100644 --- a/k8s/models/v1_13/api/coordination/v1beta1.py +++ b/k8s/models/v1_13/api/coordination/v1beta1.py @@ -35,6 +35,7 @@ class Lease(Model): """ Lease defines a lease concept. """ + class Meta: create_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases" delete_url = "/apis/coordination.k8s.io/v1beta1/namespaces/{namespace}/leases/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases/{name}" watchlist_all_url = "/apis/coordination.k8s.io/v1beta1/watch/leases" watchlist_ns_url = "/apis/coordination.k8s.io/v1beta1/watch/namespaces/{namespace}/leases" - + apiVersion = Field(six.text_type, "coordination.k8s.io/v1beta1") kind = Field(six.text_type, "Lease") @@ -62,4 +63,3 @@ class LeaseList(Model): items = ListField(Lease) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/core/v1.py b/k8s/models/v1_13/api/core/v1.py index 2725330..bd6ecb1 100644 --- a/k8s/models/v1_13/api/core/v1.py +++ b/k8s/models/v1_13/api/core/v1.py @@ -296,6 +296,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -306,7 +307,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -422,6 +423,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -432,7 +434,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -655,6 +657,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -665,7 +668,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -727,9 +730,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -906,6 +910,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -914,7 +919,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -981,6 +986,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -991,7 +997,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -1157,6 +1163,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -1167,7 +1174,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1471,6 +1478,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1481,7 +1489,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1564,6 +1572,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1574,7 +1583,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1823,6 +1832,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1833,7 +1843,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1868,10 +1878,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1935,6 +1946,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1945,7 +1957,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -2089,6 +2101,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -2097,7 +2110,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -2231,6 +2244,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -2241,7 +2255,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -2265,6 +2279,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -2275,7 +2290,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2299,6 +2314,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2309,7 +2325,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2372,6 +2388,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2380,7 +2397,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2398,4 +2415,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/events/v1beta1.py b/k8s/models/v1_13/api/events/v1beta1.py index 6eeca68..5e67962 100644 --- a/k8s/models/v1_13/api/events/v1beta1.py +++ b/k8s/models/v1_13/api/events/v1beta1.py @@ -36,6 +36,7 @@ class Event(Model): Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. """ + class Meta: create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" @@ -46,7 +47,7 @@ class Meta: watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") kind = Field(six.text_type, "Event") @@ -76,4 +77,3 @@ class EventList(Model): items = ListField(Event) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/extensions/v1beta1.py b/k8s/models/v1_13/api/extensions/v1beta1.py index a4a7d0f..f471b9b 100644 --- a/k8s/models/v1_13/api/extensions/v1beta1.py +++ b/k8s/models/v1_13/api/extensions/v1beta1.py @@ -188,6 +188,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -198,7 +199,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -304,6 +305,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -314,7 +316,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -400,6 +402,7 @@ class NetworkPolicy(Model): networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -410,7 +413,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -529,6 +532,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -539,7 +543,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -594,6 +598,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -604,7 +609,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -680,6 +685,7 @@ class PodSecurityPolicy(Model): Context that will be applied to a pod and container. Deprecated: use PodSecurityPolicy from policy API Group instead. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -688,7 +694,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -706,4 +712,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/networking/v1.py b/k8s/models/v1_13/api/networking/v1.py index 9d8ec8a..dfeb947 100644 --- a/k8s/models/v1_13/api/networking/v1.py +++ b/k8s/models/v1_13/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/policy/v1beta1.py b/k8s/models/v1_13/api/policy/v1beta1.py index 00d6531..c4f19c1 100644 --- a/k8s/models/v1_13/api/policy/v1beta1.py +++ b/k8s/models/v1_13/api/policy/v1beta1.py @@ -57,6 +57,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -67,7 +68,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -152,9 +153,10 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") @@ -214,6 +216,7 @@ class PodSecurityPolicy(Model): PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/policy/v1beta1/podsecuritypolicies" delete_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" @@ -222,7 +225,7 @@ class Meta: update_url = "/apis/policy/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/policy/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -239,4 +242,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/rbac/v1.py b/k8s/models/v1_13/api/rbac/v1.py index 12069d2..abb9d7b 100644 --- a/k8s/models/v1_13/api/rbac/v1.py +++ b/k8s/models/v1_13/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/rbac/v1alpha1.py b/k8s/models/v1_13/api/rbac/v1alpha1.py index 9d7d41d..7464133 100644 --- a/k8s/models/v1_13/api/rbac/v1alpha1.py +++ b/k8s/models/v1_13/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -171,6 +174,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -179,7 +183,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -197,4 +201,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/rbac/v1beta1.py b/k8s/models/v1_13/api/rbac/v1beta1.py index 7c1f668..317f5e0 100644 --- a/k8s/models/v1_13/api/rbac/v1beta1.py +++ b/k8s/models/v1_13/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/scheduling/v1alpha1.py b/k8s/models/v1_13/api/scheduling/v1alpha1.py index 9f09cc4..46af1bd 100644 --- a/k8s/models/v1_13/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_13/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/scheduling/v1beta1.py b/k8s/models/v1_13/api/scheduling/v1beta1.py index d628313..850e8a4 100644 --- a/k8s/models/v1_13/api/scheduling/v1beta1.py +++ b/k8s/models/v1_13/api/scheduling/v1beta1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1beta1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1beta1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1beta1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/settings/v1alpha1.py b/k8s/models/v1_13/api/settings/v1alpha1.py index 0858cd5..b010e6a 100644 --- a/k8s/models/v1_13/api/settings/v1alpha1.py +++ b/k8s/models/v1_13/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/storage/v1.py b/k8s/models/v1_13/api/storage/v1.py index f68d7cf..d0401cf 100644 --- a/k8s/models/v1_13/api/storage/v1.py +++ b/k8s/models/v1_13/api/storage/v1.py @@ -67,6 +67,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1/volumeattachments/{name}" @@ -75,7 +76,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "VolumeAttachment") @@ -104,6 +105,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -112,7 +114,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -135,4 +137,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/storage/v1alpha1.py b/k8s/models/v1_13/api/storage/v1alpha1.py index ed4cda5..bb2e13d 100644 --- a/k8s/models/v1_13/api/storage/v1alpha1.py +++ b/k8s/models/v1_13/api/storage/v1alpha1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") kind = Field(six.text_type, "VolumeAttachment") @@ -92,4 +93,3 @@ class VolumeAttachmentList(Model): items = ListField(VolumeAttachment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/api/storage/v1beta1.py b/k8s/models/v1_13/api/storage/v1beta1.py index 89b55e4..ec76111 100644 --- a/k8s/models/v1_13/api/storage/v1beta1.py +++ b/k8s/models/v1_13/api/storage/v1beta1.py @@ -67,6 +67,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" @@ -75,7 +76,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "VolumeAttachment") @@ -104,6 +105,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -112,7 +114,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -135,4 +137,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 9bdc97f..e5ede77 100644 --- a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -174,6 +174,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -182,7 +183,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -200,4 +201,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/apimachinery/apis/meta/v1.py b/k8s/models/v1_13/apimachinery/apis/meta/v1.py index f6e0899..4bb0e41 100644 --- a/k8s/models/v1_13/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_13/apimachinery/apis/meta/v1.py @@ -266,4 +266,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_13/apimachinery/runtime.py b/k8s/models/v1_13/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_13/apimachinery/runtime.py +++ b/k8s/models/v1_13/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_13/apimachinery/version.py b/k8s/models/v1_13/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_13/apimachinery/version.py +++ b/k8s/models/v1_13/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py index 0d72282..c953c25 100644 --- a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py +++ b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py index 91f764b..7741540 100644 --- a/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_13/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py index 2469447..71f3bf9 100644 --- a/k8s/models/v1_6/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -241,4 +241,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_6/apimachinery/runtime.py b/k8s/models/v1_6/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_6/apimachinery/runtime.py +++ b/k8s/models/v1_6/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_6/apimachinery/version.py b/k8s/models/v1_6/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_6/apimachinery/version.py +++ b/k8s/models/v1_6/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py index a5d7f9b..0b4072a 100644 --- a/k8s/models/v1_6/kubernetes/api/v1.py +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -139,6 +139,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -149,7 +150,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -240,6 +241,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -250,7 +252,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -431,6 +433,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -441,7 +444,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -654,6 +657,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -662,7 +666,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -708,6 +712,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -718,7 +723,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -832,6 +837,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -842,7 +848,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -888,6 +894,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -898,7 +905,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1177,6 +1184,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1187,7 +1195,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1264,6 +1272,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1274,7 +1283,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1473,6 +1482,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1483,7 +1493,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1517,10 +1527,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1660,6 +1671,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -1668,7 +1680,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -1793,6 +1805,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -1803,7 +1816,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -1827,6 +1840,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -1837,7 +1851,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -1861,6 +1875,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -1871,7 +1886,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -1928,6 +1943,7 @@ class PersistentVolume(Model): is analogous to a node. More info: http://kubernetes.io/docs/user-guide /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -1936,7 +1952,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -1954,4 +1970,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py index b02bb38..02da64e 100644 --- a/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/apps/v1beta1.py @@ -51,6 +51,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -61,7 +62,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -196,6 +197,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -206,7 +208,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -224,4 +226,3 @@ class DeploymentList(Model): items = ListField(Deployment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py index 9a73d8b..29573eb 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py index 0549606..887025e 100644 --- a/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py index 9992965..7bc7c4e 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1.py @@ -71,9 +71,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -88,9 +89,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -117,13 +119,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py index 2e0868c..6f177ad 100644 --- a/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/authorization/v1beta1.py @@ -71,9 +71,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -88,9 +89,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -117,13 +119,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py index ae0321f..56ec474 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py index 2b64126..601f288 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py @@ -155,6 +155,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -165,7 +166,7 @@ class Meta: watch_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2alpha1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -183,4 +184,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v1.py b/k8s/models/v1_6/kubernetes/apis/batch/v1.py index c0aa6ca..781a2eb 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v1.py @@ -63,6 +63,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -73,7 +74,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -91,4 +92,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py index 835b3bf..aa062fb 100644 --- a/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py index f8bd1e0..fc0dfdd 100644 --- a/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py index da656ca..9893bed 100644 --- a/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/extensions/v1beta1.py @@ -183,6 +183,7 @@ class ReplicaSet(Model): """ ReplicaSet represents the configuration of a ReplicaSet. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -193,7 +194,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -254,6 +255,7 @@ class NetworkPolicy(Model): """ """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -264,7 +266,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -359,6 +361,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -369,7 +372,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -464,6 +467,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -472,7 +476,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -522,6 +526,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -532,7 +537,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -571,6 +576,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -581,7 +587,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -615,6 +621,7 @@ class ThirdPartyResource(Model): add-ons and plugins to add new resource types to the API. It consists of one or more Versions of the api. """ + class Meta: create_url = "/apis/extensions/v1beta1/thirdpartyresources" delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" @@ -623,7 +630,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ThirdPartyResource") @@ -641,4 +648,3 @@ class ThirdPartyResourceList(Model): items = ListField(ThirdPartyResource) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py index 77cc06b..735c302 100644 --- a/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/policy/v1beta1.py @@ -45,6 +45,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -86,4 +87,3 @@ class Eviction(Model): deleteOptions = Field(DeleteOptions) metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py index 0b4a6c9..3dec7f5 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -162,6 +165,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -170,7 +174,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -187,4 +191,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py index 8a83d8a..31a9824 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -163,6 +166,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -171,7 +175,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -188,4 +192,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py index 285da22..4818e5a 100644 --- a/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1.py index 4384da7..8a4d2b2 100644 --- a/k8s/models/v1_6/kubernetes/apis/storage/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -52,4 +53,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py index f45bf77..e6c7861 100644 --- a/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/storage/v1beta1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -52,4 +53,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py index 2005c23..2739c14 100644 --- a/k8s/models/v1_7/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -262,4 +262,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_7/apimachinery/runtime.py b/k8s/models/v1_7/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_7/apimachinery/runtime.py +++ b/k8s/models/v1_7/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_7/apimachinery/version.py b/k8s/models/v1_7/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_7/apimachinery/version.py +++ b/k8s/models/v1_7/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py index acc8b9d..a15b062 100644 --- a/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_7/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py index 85cbd03..a287b4d 100644 --- a/k8s/models/v1_7/kubernetes/api/v1.py +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -143,6 +143,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -153,7 +154,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -244,6 +245,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -254,7 +256,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -435,6 +437,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -445,7 +448,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -507,9 +510,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -674,6 +678,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -682,7 +687,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -748,6 +753,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -758,7 +764,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -890,6 +896,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -900,7 +907,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -946,6 +953,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -956,7 +964,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1230,6 +1238,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1240,7 +1249,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1317,6 +1326,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1327,7 +1337,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1527,6 +1537,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1537,7 +1548,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1571,10 +1582,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1714,6 +1726,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -1722,7 +1735,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -1849,6 +1862,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -1859,7 +1873,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -1883,6 +1897,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -1893,7 +1908,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -1917,6 +1932,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -1927,7 +1943,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -1986,6 +2002,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -1994,7 +2011,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2012,4 +2029,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py index 3fc3c07..5ada5ce 100644 --- a/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/admissionregistration/v1alpha1.py @@ -64,6 +64,7 @@ class ExternalAdmissionHookConfiguration(Model): """ ExternalAdmissionHookConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" @@ -72,7 +73,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "ExternalAdmissionHookConfiguration") @@ -118,6 +119,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -126,7 +128,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -143,4 +145,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py index c49757c..369e3ee 100644 --- a/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/apps/v1beta1.py @@ -110,6 +110,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -120,7 +121,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -226,6 +227,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -236,7 +238,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -268,6 +270,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -278,7 +281,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -297,4 +300,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py index 5db933a..919082e 100644 --- a/k8s/models/v1_7/kubernetes/apis/authentication/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py index f93f184..08aec3b 100644 --- a/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py index 8946499..4df9cda 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1.py @@ -71,9 +71,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -88,9 +89,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -117,13 +119,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py index c3b208e..b7363fc 100644 --- a/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/authorization/v1beta1.py @@ -71,9 +71,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -88,9 +89,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -117,13 +119,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py index fb3d234..b6ac85c 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py index 22d0c4e..d36de59 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py @@ -169,6 +169,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2alpha1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -179,7 +180,7 @@ class Meta: watch_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2alpha1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2alpha1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2alpha1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -197,4 +198,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v1.py b/k8s/models/v1_7/kubernetes/apis/batch/v1.py index 6bdd3ac..e6601ba 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v1.py @@ -63,6 +63,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -73,7 +74,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -91,4 +92,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py index fb38527..93cf364 100644 --- a/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py index b112d8a..547a0bc 100644 --- a/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py index 09eaac3..0d852c0 100644 --- a/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/extensions/v1beta1.py @@ -184,6 +184,7 @@ class ReplicaSet(Model): """ ReplicaSet represents the configuration of a ReplicaSet. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -194,7 +195,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -255,6 +256,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -265,7 +267,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -360,6 +362,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -370,7 +373,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -465,6 +468,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -473,7 +477,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -524,6 +528,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -534,7 +539,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -574,6 +579,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -584,7 +590,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -618,6 +624,7 @@ class ThirdPartyResource(Model): add-ons and plugins to add new resource types to the API. It consists of one or more Versions of the api. """ + class Meta: create_url = "/apis/extensions/v1beta1/thirdpartyresources" delete_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" @@ -626,7 +633,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/thirdpartyresources/{name}" watch_url = "/apis/extensions/v1beta1/watch/thirdpartyresources/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/thirdpartyresources" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ThirdPartyResource") @@ -644,4 +651,3 @@ class ThirdPartyResourceList(Model): items = ListField(ThirdPartyResource) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/networking/v1.py b/k8s/models/v1_7/kubernetes/apis/networking/v1.py index cb55dd1..57faf84 100644 --- a/k8s/models/v1_7/kubernetes/apis/networking/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/networking/v1.py @@ -60,6 +60,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -70,7 +71,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -87,4 +88,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py index c200a84..eb32ba7 100644 --- a/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/policy/v1beta1.py @@ -46,6 +46,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -82,12 +83,12 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") deleteOptions = Field(DeleteOptions) metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py index c414103..e5767d6 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -162,6 +165,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -170,7 +174,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -187,4 +191,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py index 790bbba..04d56b6 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -163,6 +166,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -171,7 +175,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -188,4 +192,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py index 07ea03c..b153916 100644 --- a/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1.py index 5fc7e04..1967a29 100644 --- a/k8s/models/v1_7/kubernetes/apis/storage/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -52,4 +53,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py index 81d413a..7d6abb0 100644 --- a/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/storage/v1beta1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -52,4 +53,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/admissionregistration/v1alpha1.py b/k8s/models/v1_8/api/admissionregistration/v1alpha1.py index f7c0fb4..e8eceb8 100644 --- a/k8s/models/v1_8/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_8/api/admissionregistration/v1alpha1.py @@ -64,6 +64,7 @@ class ExternalAdmissionHookConfiguration(Model): """ ExternalAdmissionHookConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" @@ -72,7 +73,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/externaladmissionhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/externaladmissionhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "ExternalAdmissionHookConfiguration") @@ -117,6 +118,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -125,7 +127,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -142,4 +144,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/apps/v1beta1.py b/k8s/models/v1_8/api/apps/v1beta1.py index 804c869..487e700 100644 --- a/k8s/models/v1_8/api/apps/v1beta1.py +++ b/k8s/models/v1_8/api/apps/v1beta1.py @@ -113,6 +113,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -123,7 +124,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -232,6 +233,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -242,7 +244,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -276,6 +278,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -286,7 +289,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -305,4 +308,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/apps/v1beta2.py b/k8s/models/v1_8/api/apps/v1beta2.py index d3c72bb..b2f91d2 100644 --- a/k8s/models/v1_8/api/apps/v1beta2.py +++ b/k8s/models/v1_8/api/apps/v1beta2.py @@ -111,6 +111,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -121,7 +122,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -244,6 +245,7 @@ class ReplicaSet(Model): """ ReplicaSet represents the configuration of a ReplicaSet. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -254,7 +256,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -306,6 +308,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -316,7 +319,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -356,6 +359,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -366,7 +370,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -398,6 +402,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -408,7 +413,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -427,4 +432,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/authentication/v1.py b/k8s/models/v1_8/api/authentication/v1.py index 23963d3..d37cf61 100644 --- a/k8s/models/v1_8/api/authentication/v1.py +++ b/k8s/models/v1_8/api/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_8/api/authentication/v1beta1.py b/k8s/models/v1_8/api/authentication/v1beta1.py index dce6f47..218b51f 100644 --- a/k8s/models/v1_8/api/authentication/v1beta1.py +++ b/k8s/models/v1_8/api/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_8/api/authorization/v1.py b/k8s/models/v1_8/api/authorization/v1.py index 0522873..3ad2530 100644 --- a/k8s/models/v1_8/api/authorization/v1.py +++ b/k8s/models/v1_8/api/authorization/v1.py @@ -99,9 +99,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -140,9 +141,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -157,9 +159,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -186,13 +189,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_8/api/authorization/v1beta1.py b/k8s/models/v1_8/api/authorization/v1beta1.py index 2744fe9..ead1706 100644 --- a/k8s/models/v1_8/api/authorization/v1beta1.py +++ b/k8s/models/v1_8/api/authorization/v1beta1.py @@ -99,9 +99,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -140,9 +141,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -157,9 +159,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -186,13 +189,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_8/api/autoscaling/v1.py b/k8s/models/v1_8/api/autoscaling/v1.py index 1dc4c72..8f21343 100644 --- a/k8s/models/v1_8/api/autoscaling/v1.py +++ b/k8s/models/v1_8/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/autoscaling/v2beta1.py b/k8s/models/v1_8/api/autoscaling/v2beta1.py index c3bf064..ca45803 100644 --- a/k8s/models/v1_8/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_8/api/autoscaling/v2beta1.py @@ -169,6 +169,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -179,7 +180,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -197,4 +198,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/batch/v1.py b/k8s/models/v1_8/api/batch/v1.py index bdc492f..3c40eae 100644 --- a/k8s/models/v1_8/api/batch/v1.py +++ b/k8s/models/v1_8/api/batch/v1.py @@ -64,6 +64,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -74,7 +75,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -92,4 +93,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/batch/v1beta1.py b/k8s/models/v1_8/api/batch/v1beta1.py index 577ed6e..d9fce66 100644 --- a/k8s/models/v1_8/api/batch/v1beta1.py +++ b/k8s/models/v1_8/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/batch/v2alpha1.py b/k8s/models/v1_8/api/batch/v2alpha1.py index 45c9ac9..11ec13c 100644 --- a/k8s/models/v1_8/api/batch/v2alpha1.py +++ b/k8s/models/v1_8/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/certificates/v1beta1.py b/k8s/models/v1_8/api/certificates/v1beta1.py index 364bc3b..6720ed8 100644 --- a/k8s/models/v1_8/api/certificates/v1beta1.py +++ b/k8s/models/v1_8/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/core/v1.py b/k8s/models/v1_8/api/core/v1.py index 4adc7b3..ba9cc27 100644 --- a/k8s/models/v1_8/api/core/v1.py +++ b/k8s/models/v1_8/api/core/v1.py @@ -155,6 +155,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -165,7 +166,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -256,6 +257,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -266,7 +268,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -461,6 +463,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -471,7 +474,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -557,9 +560,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -724,6 +728,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -732,7 +737,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -798,6 +803,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -808,7 +814,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -960,6 +966,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -970,7 +977,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1246,6 +1253,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1256,7 +1264,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1333,6 +1341,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1343,7 +1352,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1543,6 +1552,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1553,7 +1563,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1587,10 +1597,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1654,6 +1665,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1664,7 +1676,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -1817,6 +1829,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -1825,7 +1838,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -1954,6 +1967,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -1964,7 +1978,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -1988,6 +2002,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -1998,7 +2013,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2022,6 +2037,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2032,7 +2048,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2092,6 +2108,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2100,7 +2117,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2118,4 +2135,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/extensions/v1beta1.py b/k8s/models/v1_8/api/extensions/v1beta1.py index 27224f1..e8ee8a7 100644 --- a/k8s/models/v1_8/api/extensions/v1beta1.py +++ b/k8s/models/v1_8/api/extensions/v1beta1.py @@ -187,6 +187,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet represents the configuration of a ReplicaSet. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -197,7 +198,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -302,6 +303,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -312,7 +314,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -389,6 +391,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -399,7 +402,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -501,6 +504,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -511,7 +515,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -553,6 +557,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -563,7 +568,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -621,6 +626,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -629,7 +635,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -646,4 +652,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/networking/v1.py b/k8s/models/v1_8/api/networking/v1.py index 93d7a98..7c22319 100644 --- a/k8s/models/v1_8/api/networking/v1.py +++ b/k8s/models/v1_8/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/policy/v1beta1.py b/k8s/models/v1_8/api/policy/v1beta1.py index 6fc55ec..650e934 100644 --- a/k8s/models/v1_8/api/policy/v1beta1.py +++ b/k8s/models/v1_8/api/policy/v1beta1.py @@ -46,6 +46,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -82,12 +83,12 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") deleteOptions = Field(DeleteOptions) metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_8/api/rbac/v1.py b/k8s/models/v1_8/api/rbac/v1.py index c104cef..11bab11 100644 --- a/k8s/models/v1_8/api/rbac/v1.py +++ b/k8s/models/v1_8/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -163,6 +166,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -171,7 +175,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -188,4 +192,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/rbac/v1alpha1.py b/k8s/models/v1_8/api/rbac/v1alpha1.py index 230ebca..e2b48ed 100644 --- a/k8s/models/v1_8/api/rbac/v1alpha1.py +++ b/k8s/models/v1_8/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -162,6 +165,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -170,7 +174,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -187,4 +191,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/rbac/v1beta1.py b/k8s/models/v1_8/api/rbac/v1beta1.py index 93e4f8b..05016ec 100644 --- a/k8s/models/v1_8/api/rbac/v1beta1.py +++ b/k8s/models/v1_8/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -163,6 +166,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -171,7 +175,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -188,4 +192,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/scheduling/v1alpha1.py b/k8s/models/v1_8/api/scheduling/v1alpha1.py index 46da6f8..5611109 100644 --- a/k8s/models/v1_8/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_8/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/settings/v1alpha1.py b/k8s/models/v1_8/api/settings/v1alpha1.py index e59e9ad..75f0148 100644 --- a/k8s/models/v1_8/api/settings/v1alpha1.py +++ b/k8s/models/v1_8/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/storage/v1.py b/k8s/models/v1_8/api/storage/v1.py index 0c0b898..ecb4482 100644 --- a/k8s/models/v1_8/api/storage/v1.py +++ b/k8s/models/v1_8/api/storage/v1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -55,4 +56,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/api/storage/v1beta1.py b/k8s/models/v1_8/api/storage/v1beta1.py index 60da32f..856a25c 100644 --- a/k8s/models/v1_8/api/storage/v1beta1.py +++ b/k8s/models/v1_8/api/storage/v1beta1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -55,4 +56,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 97587c8..6a01b44 100644 --- a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -90,6 +90,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -98,7 +99,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -116,4 +117,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_8/apimachinery/apis/meta/v1.py b/k8s/models/v1_8/apimachinery/apis/meta/v1.py index b9fce77..40225c4 100644 --- a/k8s/models/v1_8/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_8/apimachinery/apis/meta/v1.py @@ -265,4 +265,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_8/apimachinery/runtime.py b/k8s/models/v1_8/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_8/apimachinery/runtime.py +++ b/k8s/models/v1_8/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_8/apimachinery/version.py b/k8s/models/v1_8/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_8/apimachinery/version.py +++ b/k8s/models/v1_8/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py index 587dea1..ad3a3a6 100644 --- a/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_8/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/admissionregistration/v1alpha1.py b/k8s/models/v1_9/api/admissionregistration/v1alpha1.py index 1dc2bed..85cc20b 100644 --- a/k8s/models/v1_9/api/admissionregistration/v1alpha1.py +++ b/k8s/models/v1_9/api/admissionregistration/v1alpha1.py @@ -42,6 +42,7 @@ class InitializerConfiguration(Model): """ InitializerConfiguration describes the configuration of initializers. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" @@ -50,7 +51,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1alpha1/initializerconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1alpha1/watch/initializerconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1alpha1") kind = Field(six.text_type, "InitializerConfiguration") @@ -67,4 +68,3 @@ class InitializerConfigurationList(Model): items = ListField(InitializerConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/admissionregistration/v1beta1.py b/k8s/models/v1_9/api/admissionregistration/v1beta1.py index 288b27b..0724949 100644 --- a/k8s/models/v1_9/api/admissionregistration/v1beta1.py +++ b/k8s/models/v1_9/api/admissionregistration/v1beta1.py @@ -68,6 +68,7 @@ class ValidatingWebhookConfiguration(Model): ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" @@ -76,7 +77,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/validatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/validatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "ValidatingWebhookConfiguration") @@ -100,6 +101,7 @@ class MutatingWebhookConfiguration(Model): MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object. """ + class Meta: create_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations" delete_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" @@ -108,7 +110,7 @@ class Meta: update_url = "/apis/admissionregistration.k8s.io/v1beta1/mutatingwebhookconfigurations/{name}" watch_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations/{name}" watchlist_all_url = "/apis/admissionregistration.k8s.io/v1beta1/watch/mutatingwebhookconfigurations" - + apiVersion = Field(six.text_type, "admissionregistration.k8s.io/v1beta1") kind = Field(six.text_type, "MutatingWebhookConfiguration") @@ -125,4 +127,3 @@ class MutatingWebhookConfigurationList(Model): items = ListField(MutatingWebhookConfiguration) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/apps/v1.py b/k8s/models/v1_9/api/apps/v1.py index 04c17b6..f56f4a4 100644 --- a/k8s/models/v1_9/api/apps/v1.py +++ b/k8s/models/v1_9/api/apps/v1.py @@ -94,6 +94,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}" @@ -104,7 +105,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "StatefulSet") @@ -228,6 +229,7 @@ class ReplicaSet(Model): ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1/namespaces/{namespace}/replicasets/{name}" @@ -238,7 +240,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1/watch/replicasets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ReplicaSet") @@ -290,6 +292,7 @@ class Deployment(Model): """ Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1/namespaces/{namespace}/deployments/{name}" @@ -300,7 +303,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1/watch/deployments" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "Deployment") @@ -353,6 +356,7 @@ class DaemonSet(Model): """ DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}" @@ -363,7 +367,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "DaemonSet") @@ -395,6 +399,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}" @@ -405,7 +410,7 @@ class Meta: watch_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1") kind = Field(six.text_type, "ControllerRevision") @@ -424,4 +429,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/apps/v1beta1.py b/k8s/models/v1_9/api/apps/v1beta1.py index 89d388d..1ea4492 100644 --- a/k8s/models/v1_9/api/apps/v1beta1.py +++ b/k8s/models/v1_9/api/apps/v1beta1.py @@ -126,6 +126,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/statefulsets/{name}" @@ -136,7 +137,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "StatefulSet") @@ -245,6 +246,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -255,7 +257,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "Deployment") @@ -289,6 +291,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta1/namespaces/{namespace}/controllerrevisions/{name}" @@ -299,7 +302,7 @@ class Meta: watch_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta1/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta1/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta1") kind = Field(six.text_type, "ControllerRevision") @@ -318,4 +321,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/apps/v1beta2.py b/k8s/models/v1_9/api/apps/v1beta2.py index 9179c7f..8cff5e8 100644 --- a/k8s/models/v1_9/api/apps/v1beta2.py +++ b/k8s/models/v1_9/api/apps/v1beta2.py @@ -125,6 +125,7 @@ class StatefulSet(Model): The StatefulSet guarantees that a given network identity will always map to the same storage identity. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/statefulsets/{name}" @@ -135,7 +136,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/statefulsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/statefulsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "StatefulSet") @@ -260,6 +261,7 @@ class ReplicaSet(Model): apps/v1/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/replicasets/{name}" @@ -270,7 +272,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/replicasets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ReplicaSet") @@ -324,6 +326,7 @@ class Deployment(Model): apps/v1/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/deployments/{name}" @@ -334,7 +337,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/deployments" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "Deployment") @@ -389,6 +392,7 @@ class DaemonSet(Model): apps/v1/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/daemonsets/{name}" @@ -399,7 +403,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/daemonsets" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "DaemonSet") @@ -433,6 +437,7 @@ class ControllerRevision(Model): and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers. """ + class Meta: create_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions" delete_url = "/apis/apps/v1beta2/namespaces/{namespace}/controllerrevisions/{name}" @@ -443,7 +448,7 @@ class Meta: watch_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions/{name}" watchlist_all_url = "/apis/apps/v1beta2/watch/controllerrevisions" watchlist_ns_url = "/apis/apps/v1beta2/watch/namespaces/{namespace}/controllerrevisions" - + apiVersion = Field(six.text_type, "apps/v1beta2") kind = Field(six.text_type, "ControllerRevision") @@ -462,4 +467,3 @@ class ControllerRevisionList(Model): items = ListField(ControllerRevision) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/authentication/v1.py b/k8s/models/v1_9/api/authentication/v1.py index ca9a706..26d3120 100644 --- a/k8s/models/v1_9/api/authentication/v1.py +++ b/k8s/models/v1_9/api/authentication/v1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_9/api/authentication/v1beta1.py b/k8s/models/v1_9/api/authentication/v1beta1.py index b4224cf..0169921 100644 --- a/k8s/models/v1_9/api/authentication/v1beta1.py +++ b/k8s/models/v1_9/api/authentication/v1beta1.py @@ -53,13 +53,13 @@ class TokenReview(Model): requests may be cached by the webhook token authenticator plugin in the kube- apiserver. """ + class Meta: create_url = "/apis/authentication.k8s.io/v1beta1/tokenreviews" - + apiVersion = Field(six.text_type, "authentication.k8s.io/v1beta1") kind = Field(six.text_type, "TokenReview") metadata = Field(ObjectMeta) spec = RequiredField(TokenReviewSpec) status = Field(TokenReviewStatus) - diff --git a/k8s/models/v1_9/api/authorization/v1.py b/k8s/models/v1_9/api/authorization/v1.py index 9de1e79..db91f11 100644 --- a/k8s/models/v1_9/api/authorization/v1.py +++ b/k8s/models/v1_9/api/authorization/v1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_9/api/authorization/v1beta1.py b/k8s/models/v1_9/api/authorization/v1beta1.py index 9cef49d..dd6a79c 100644 --- a/k8s/models/v1_9/api/authorization/v1beta1.py +++ b/k8s/models/v1_9/api/authorization/v1beta1.py @@ -100,9 +100,10 @@ class SelfSubjectRulesReview(Model): SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectrulesreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectRulesReview") @@ -141,9 +142,10 @@ class SubjectAccessReview(Model): SubjectAccessReview checks whether or not a user or group can perform an action. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/subjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SubjectAccessReview") @@ -158,9 +160,10 @@ class LocalSubjectAccessReview(Model): action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking. """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/namespaces/{namespace}/localsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "LocalSubjectAccessReview") @@ -187,13 +190,13 @@ class SelfSubjectAccessReview(Model): special case, because users should always be able to check whether they can perform an action """ + class Meta: create_url = "/apis/authorization.k8s.io/v1beta1/selfsubjectaccessreviews" - + apiVersion = Field(six.text_type, "authorization.k8s.io/v1beta1") kind = Field(six.text_type, "SelfSubjectAccessReview") metadata = Field(ObjectMeta) spec = RequiredField(SelfSubjectAccessReviewSpec) status = Field(SubjectAccessReviewStatus) - diff --git a/k8s/models/v1_9/api/autoscaling/v1.py b/k8s/models/v1_9/api/autoscaling/v1.py index 86e4adf..7d66516 100644 --- a/k8s/models/v1_9/api/autoscaling/v1.py +++ b/k8s/models/v1_9/api/autoscaling/v1.py @@ -84,6 +84,7 @@ class HorizontalPodAutoscaler(Model): """ configuration of a horizontal pod autoscaler. """ + class Meta: create_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -94,7 +95,7 @@ class Meta: watch_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -112,4 +113,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/autoscaling/v2beta1.py b/k8s/models/v1_9/api/autoscaling/v2beta1.py index c10c8a4..5ed4b01 100644 --- a/k8s/models/v1_9/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_9/api/autoscaling/v2beta1.py @@ -169,6 +169,7 @@ class HorizontalPodAutoscaler(Model): which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified. """ + class Meta: create_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers" delete_url = "/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}" @@ -179,7 +180,7 @@ class Meta: watch_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers/{name}" watchlist_all_url = "/apis/autoscaling/v2beta1/watch/horizontalpodautoscalers" watchlist_ns_url = "/apis/autoscaling/v2beta1/watch/namespaces/{namespace}/horizontalpodautoscalers" - + apiVersion = Field(six.text_type, "autoscaling/v2beta1") kind = Field(six.text_type, "HorizontalPodAutoscaler") @@ -197,4 +198,3 @@ class HorizontalPodAutoscalerList(Model): items = ListField(HorizontalPodAutoscaler) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/batch/v1.py b/k8s/models/v1_9/api/batch/v1.py index b9a6f07..8b13c1c 100644 --- a/k8s/models/v1_9/api/batch/v1.py +++ b/k8s/models/v1_9/api/batch/v1.py @@ -64,6 +64,7 @@ class Job(Model): """ Job represents the configuration of a single job. """ + class Meta: create_url = "/apis/batch/v1/namespaces/{namespace}/jobs" delete_url = "/apis/batch/v1/namespaces/{namespace}/jobs/{name}" @@ -74,7 +75,7 @@ class Meta: watch_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs/{name}" watchlist_all_url = "/apis/batch/v1/watch/jobs" watchlist_ns_url = "/apis/batch/v1/watch/namespaces/{namespace}/jobs" - + apiVersion = Field(six.text_type, "batch/v1") kind = Field(six.text_type, "Job") @@ -92,4 +93,3 @@ class JobList(Model): items = ListField(Job) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/batch/v1beta1.py b/k8s/models/v1_9/api/batch/v1beta1.py index a100e59..d127aba 100644 --- a/k8s/models/v1_9/api/batch/v1beta1.py +++ b/k8s/models/v1_9/api/batch/v1beta1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v1beta1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v1beta1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v1beta1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/batch/v2alpha1.py b/k8s/models/v1_9/api/batch/v2alpha1.py index 5b2b78c..73f5ee5 100644 --- a/k8s/models/v1_9/api/batch/v2alpha1.py +++ b/k8s/models/v1_9/api/batch/v2alpha1.py @@ -59,6 +59,7 @@ class CronJob(Model): """ CronJob represents the configuration of a single cron job. """ + class Meta: create_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs" delete_url = "/apis/batch/v2alpha1/namespaces/{namespace}/cronjobs/{name}" @@ -69,7 +70,7 @@ class Meta: watch_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs/{name}" watchlist_all_url = "/apis/batch/v2alpha1/watch/cronjobs" watchlist_ns_url = "/apis/batch/v2alpha1/watch/namespaces/{namespace}/cronjobs" - + apiVersion = Field(six.text_type, "batch/v2alpha1") kind = Field(six.text_type, "CronJob") @@ -87,4 +88,3 @@ class CronJobList(Model): items = ListField(CronJob) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/certificates/v1beta1.py b/k8s/models/v1_9/api/certificates/v1beta1.py index 7c7f861..5a3372c 100644 --- a/k8s/models/v1_9/api/certificates/v1beta1.py +++ b/k8s/models/v1_9/api/certificates/v1beta1.py @@ -58,6 +58,7 @@ class CertificateSigningRequest(Model): """ Describes a certificate signing request """ + class Meta: create_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests" delete_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" @@ -66,7 +67,7 @@ class Meta: update_url = "/apis/certificates.k8s.io/v1beta1/certificatesigningrequests/{name}" watch_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests/{name}" watchlist_all_url = "/apis/certificates.k8s.io/v1beta1/watch/certificatesigningrequests" - + apiVersion = Field(six.text_type, "certificates.k8s.io/v1beta1") kind = Field(six.text_type, "CertificateSigningRequest") @@ -84,4 +85,3 @@ class CertificateSigningRequestList(Model): items = ListField(CertificateSigningRequest) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/core/v1.py b/k8s/models/v1_9/api/core/v1.py index 504c40b..2d803d4 100644 --- a/k8s/models/v1_9/api/core/v1.py +++ b/k8s/models/v1_9/api/core/v1.py @@ -200,6 +200,7 @@ class Secret(Model): Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/secrets" delete_url = "/api/v1/namespaces/{namespace}/secrets/{name}" @@ -210,7 +211,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/secrets/{name}" watchlist_all_url = "/api/v1/watch/secrets" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/secrets" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Secret") @@ -302,6 +303,7 @@ class ResourceQuota(Model): """ ResourceQuota sets aggregate quota restrictions enforced per namespace """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/resourcequotas" delete_url = "/api/v1/namespaces/{namespace}/resourcequotas/{name}" @@ -312,7 +314,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas/{name}" watchlist_all_url = "/api/v1/watch/resourcequotas" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/resourcequotas" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ResourceQuota") @@ -527,6 +529,7 @@ class PersistentVolumeClaim(Model): """ PersistentVolumeClaim is a user's request for and claim to a persistent volume """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims" delete_url = "/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}" @@ -537,7 +540,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumeclaims" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/persistentvolumeclaims" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolumeClaim") @@ -623,9 +626,10 @@ class Binding(Model): scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/binding" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Binding") @@ -790,6 +794,7 @@ class Namespace(Model): """ Namespace provides a scope for Names. Use of multiple namespaces is optional. """ + class Meta: create_url = "/api/v1/namespaces" delete_url = "/api/v1/namespaces/{name}" @@ -798,7 +803,7 @@ class Meta: update_url = "/api/v1/namespaces/{name}" watch_url = "/api/v1/watch/namespaces/{name}" watchlist_all_url = "/api/v1/watch/namespaces" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Namespace") @@ -864,6 +869,7 @@ class ServiceAccount(Model): peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/serviceaccounts" delete_url = "/api/v1/namespaces/{namespace}/serviceaccounts/{name}" @@ -874,7 +880,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts/{name}" watchlist_all_url = "/api/v1/watch/serviceaccounts" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/serviceaccounts" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ServiceAccount") @@ -1026,6 +1032,7 @@ class LimitRange(Model): """ LimitRange sets resource usage limits for each kind of resource in a Namespace. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/limitranges" delete_url = "/api/v1/namespaces/{namespace}/limitranges/{name}" @@ -1036,7 +1043,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/limitranges/{name}" watchlist_all_url = "/api/v1/watch/limitranges" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/limitranges" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "LimitRange") @@ -1323,6 +1330,7 @@ class Event(Model): """ Event is a report of an event somewhere in the cluster. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/events" delete_url = "/api/v1/namespaces/{namespace}/events/{name}" @@ -1333,7 +1341,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/api/v1/watch/events" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Event") @@ -1416,6 +1424,7 @@ class Endpoints(Model): }, ] """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/endpoints" delete_url = "/api/v1/namespaces/{namespace}/endpoints/{name}" @@ -1426,7 +1435,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/endpoints/{name}" watchlist_all_url = "/api/v1/watch/endpoints" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/endpoints" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Endpoints") @@ -1626,6 +1635,7 @@ class ConfigMap(Model): """ ConfigMap holds configuration data for pods to consume. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/configmaps" delete_url = "/api/v1/namespaces/{namespace}/configmaps/{name}" @@ -1636,7 +1646,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/configmaps/{name}" watchlist_all_url = "/api/v1/watch/configmaps" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/configmaps" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ConfigMap") @@ -1670,10 +1680,11 @@ class ComponentStatus(Model): """ ComponentStatus (and ComponentStatusList) holds the cluster validation info. """ + class Meta: get_url = "/api/v1/componentstatuses/{name}" list_all_url = "/api/v1/componentstatuses" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ComponentStatus") @@ -1737,6 +1748,7 @@ class Service(Model): selector that determines which pods will answer requests sent through the proxy. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/services" delete_url = "/api/v1/namespaces/{namespace}/services/{name}" @@ -1747,7 +1759,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/services/{name}" watchlist_all_url = "/api/v1/watch/services" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/services" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Service") @@ -1911,6 +1923,7 @@ class Node(Model): Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd). """ + class Meta: create_url = "/api/v1/nodes" delete_url = "/api/v1/nodes/{name}" @@ -1919,7 +1932,7 @@ class Meta: update_url = "/api/v1/nodes/{name}" watch_url = "/api/v1/watch/nodes/{name}" watchlist_all_url = "/api/v1/watch/nodes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Node") @@ -2049,6 +2062,7 @@ class ReplicationController(Model): """ ReplicationController represents the configuration of a replication controller. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/replicationcontrollers" delete_url = "/api/v1/namespaces/{namespace}/replicationcontrollers/{name}" @@ -2059,7 +2073,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers/{name}" watchlist_all_url = "/api/v1/watch/replicationcontrollers" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/replicationcontrollers" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "ReplicationController") @@ -2083,6 +2097,7 @@ class PodTemplate(Model): """ PodTemplate describes a template for creating copies of a predefined pod. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/podtemplates" delete_url = "/api/v1/namespaces/{namespace}/podtemplates/{name}" @@ -2093,7 +2108,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/podtemplates/{name}" watchlist_all_url = "/api/v1/watch/podtemplates" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/podtemplates" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PodTemplate") @@ -2117,6 +2132,7 @@ class Pod(Model): Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods" delete_url = "/api/v1/namespaces/{namespace}/pods/{name}" @@ -2127,7 +2143,7 @@ class Meta: watch_url = "/api/v1/watch/namespaces/{namespace}/pods/{name}" watchlist_all_url = "/api/v1/watch/pods" watchlist_ns_url = "/api/v1/watch/namespaces/{namespace}/pods" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "Pod") @@ -2189,6 +2205,7 @@ class PersistentVolume(Model): is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage /persistent-volumes """ + class Meta: create_url = "/api/v1/persistentvolumes" delete_url = "/api/v1/persistentvolumes/{name}" @@ -2197,7 +2214,7 @@ class Meta: update_url = "/api/v1/persistentvolumes/{name}" watch_url = "/api/v1/watch/persistentvolumes/{name}" watchlist_all_url = "/api/v1/watch/persistentvolumes" - + apiVersion = Field(six.text_type, "v1") kind = Field(six.text_type, "PersistentVolume") @@ -2215,4 +2232,3 @@ class PersistentVolumeList(Model): items = ListField(PersistentVolume) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/events/v1beta1.py b/k8s/models/v1_9/api/events/v1beta1.py index 6420d71..650aa68 100644 --- a/k8s/models/v1_9/api/events/v1beta1.py +++ b/k8s/models/v1_9/api/events/v1beta1.py @@ -36,6 +36,7 @@ class Event(Model): Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. """ + class Meta: create_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events" delete_url = "/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}" @@ -46,7 +47,7 @@ class Meta: watch_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events/{name}" watchlist_all_url = "/apis/events.k8s.io/v1beta1/watch/events" watchlist_ns_url = "/apis/events.k8s.io/v1beta1/watch/namespaces/{namespace}/events" - + apiVersion = Field(six.text_type, "events.k8s.io/v1beta1") kind = Field(six.text_type, "Event") @@ -76,4 +77,3 @@ class EventList(Model): items = ListField(Event) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/extensions/v1beta1.py b/k8s/models/v1_9/api/extensions/v1beta1.py index d6c1dc7..ae32cac 100644 --- a/k8s/models/v1_9/api/extensions/v1beta1.py +++ b/k8s/models/v1_9/api/extensions/v1beta1.py @@ -187,6 +187,7 @@ class ReplicaSet(Model): apps/v1beta2/ReplicaSet. See the release notes for more information. ReplicaSet ensures that a specified number of pod replicas are running at any given time. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/replicasets/{name}" @@ -197,7 +198,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/replicasets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/replicasets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "ReplicaSet") @@ -303,6 +304,7 @@ class Ingress(Model): externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/ingresses/{name}" @@ -313,7 +315,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/ingresses" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/ingresses" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Ingress") @@ -399,6 +401,7 @@ class NetworkPolicy(Model): networking/v1/NetworkPolicy. NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/networkpolicies/{name}" @@ -409,7 +412,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/networkpolicies" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "NetworkPolicy") @@ -513,6 +516,7 @@ class Deployment(Model): apps/v1beta2/Deployment. See the release notes for more information. Deployment enables declarative updates for Pods and ReplicaSets. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}" @@ -523,7 +527,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/deployments" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/deployments" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "Deployment") @@ -578,6 +582,7 @@ class DaemonSet(Model): apps/v1beta2/DaemonSet. See the release notes for more information. DaemonSet represents the configuration of a daemon set. """ + class Meta: create_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets" delete_url = "/apis/extensions/v1beta1/namespaces/{namespace}/daemonsets/{name}" @@ -588,7 +593,7 @@ class Meta: watch_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/daemonsets" watchlist_ns_url = "/apis/extensions/v1beta1/watch/namespaces/{namespace}/daemonsets" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "DaemonSet") @@ -655,6 +660,7 @@ class PodSecurityPolicy(Model): Pod Security Policy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. """ + class Meta: create_url = "/apis/extensions/v1beta1/podsecuritypolicies" delete_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" @@ -663,7 +669,7 @@ class Meta: update_url = "/apis/extensions/v1beta1/podsecuritypolicies/{name}" watch_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies/{name}" watchlist_all_url = "/apis/extensions/v1beta1/watch/podsecuritypolicies" - + apiVersion = Field(six.text_type, "extensions/v1beta1") kind = Field(six.text_type, "PodSecurityPolicy") @@ -680,4 +686,3 @@ class PodSecurityPolicyList(Model): items = ListField(PodSecurityPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/networking/v1.py b/k8s/models/v1_9/api/networking/v1.py index 56e80bb..cd41b8e 100644 --- a/k8s/models/v1_9/api/networking/v1.py +++ b/k8s/models/v1_9/api/networking/v1.py @@ -85,6 +85,7 @@ class NetworkPolicy(Model): """ NetworkPolicy describes what network traffic is allowed for a set of Pods """ + class Meta: create_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies" delete_url = "/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}" @@ -95,7 +96,7 @@ class Meta: watch_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies/{name}" watchlist_all_url = "/apis/networking.k8s.io/v1/watch/networkpolicies" watchlist_ns_url = "/apis/networking.k8s.io/v1/watch/namespaces/{namespace}/networkpolicies" - + apiVersion = Field(six.text_type, "networking.k8s.io/v1") kind = Field(six.text_type, "NetworkPolicy") @@ -112,4 +113,3 @@ class NetworkPolicyList(Model): items = ListField(NetworkPolicy) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/policy/v1beta1.py b/k8s/models/v1_9/api/policy/v1beta1.py index 8240fe4..883f4c1 100644 --- a/k8s/models/v1_9/api/policy/v1beta1.py +++ b/k8s/models/v1_9/api/policy/v1beta1.py @@ -46,6 +46,7 @@ class PodDisruptionBudget(Model): PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods """ + class Meta: create_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets" delete_url = "/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets/{name}" watchlist_all_url = "/apis/policy/v1beta1/watch/poddisruptionbudgets" watchlist_ns_url = "/apis/policy/v1beta1/watch/namespaces/{namespace}/poddisruptionbudgets" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "PodDisruptionBudget") @@ -82,12 +83,12 @@ class Eviction(Model): constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions. """ + class Meta: create_url = "/api/v1/namespaces/{namespace}/pods/{name}/eviction" - + apiVersion = Field(six.text_type, "policy/v1beta1") kind = Field(six.text_type, "Eviction") deleteOptions = Field(DeleteOptions) metadata = Field(ObjectMeta) - diff --git a/k8s/models/v1_9/api/rbac/v1.py b/k8s/models/v1_9/api/rbac/v1.py index 7b83ca9..4c65a7c 100644 --- a/k8s/models/v1_9/api/rbac/v1.py +++ b/k8s/models/v1_9/api/rbac/v1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/rbac/v1alpha1.py b/k8s/models/v1_9/api/rbac/v1alpha1.py index 35b3d09..c825333 100644 --- a/k8s/models/v1_9/api/rbac/v1alpha1.py +++ b/k8s/models/v1_9/api/rbac/v1alpha1.py @@ -45,6 +45,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}" @@ -55,7 +56,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "RoleBinding") @@ -81,6 +82,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" @@ -89,7 +91,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -128,6 +130,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}" @@ -138,7 +141,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "Role") @@ -171,6 +174,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" @@ -179,7 +183,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1alpha1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1alpha1") kind = Field(six.text_type, "ClusterRole") @@ -197,4 +201,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/rbac/v1beta1.py b/k8s/models/v1_9/api/rbac/v1beta1.py index df7db11..ee751e8 100644 --- a/k8s/models/v1_9/api/rbac/v1beta1.py +++ b/k8s/models/v1_9/api/rbac/v1beta1.py @@ -46,6 +46,7 @@ class RoleBinding(Model): exists in. RoleBindings in a given namespace only have effect in that namespace. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/rolebindings/{name}" @@ -56,7 +57,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/rolebindings" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/rolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "RoleBinding") @@ -82,6 +83,7 @@ class ClusterRoleBinding(Model): reference a ClusterRole in the global namespace, and adds who information via Subject. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" @@ -90,7 +92,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterrolebindings/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterrolebindings" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRoleBinding") @@ -129,6 +131,7 @@ class Role(Model): Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/namespaces/{namespace}/roles/{name}" @@ -139,7 +142,7 @@ class Meta: watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/roles" watchlist_ns_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/namespaces/{namespace}/roles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "Role") @@ -172,6 +175,7 @@ class ClusterRole(Model): ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. """ + class Meta: create_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles" delete_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" @@ -180,7 +184,7 @@ class Meta: update_url = "/apis/rbac.authorization.k8s.io/v1beta1/clusterroles/{name}" watch_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles/{name}" watchlist_all_url = "/apis/rbac.authorization.k8s.io/v1beta1/watch/clusterroles" - + apiVersion = Field(six.text_type, "rbac.authorization.k8s.io/v1beta1") kind = Field(six.text_type, "ClusterRole") @@ -198,4 +202,3 @@ class ClusterRoleList(Model): items = ListField(ClusterRole) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/scheduling/v1alpha1.py b/k8s/models/v1_9/api/scheduling/v1alpha1.py index bc34b8d..b91150e 100644 --- a/k8s/models/v1_9/api/scheduling/v1alpha1.py +++ b/k8s/models/v1_9/api/scheduling/v1alpha1.py @@ -22,6 +22,7 @@ class PriorityClass(Model): PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer. """ + class Meta: create_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses" delete_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" @@ -30,7 +31,7 @@ class Meta: update_url = "/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}" watch_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses/{name}" watchlist_all_url = "/apis/scheduling.k8s.io/v1alpha1/watch/priorityclasses" - + apiVersion = Field(six.text_type, "scheduling.k8s.io/v1alpha1") kind = Field(six.text_type, "PriorityClass") @@ -49,4 +50,3 @@ class PriorityClassList(Model): items = ListField(PriorityClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/settings/v1alpha1.py b/k8s/models/v1_9/api/settings/v1alpha1.py index 5434bcb..e6b4833 100644 --- a/k8s/models/v1_9/api/settings/v1alpha1.py +++ b/k8s/models/v1_9/api/settings/v1alpha1.py @@ -35,6 +35,7 @@ class PodPreset(Model): PodPreset is a policy resource that defines additional runtime requirements for a Pod. """ + class Meta: create_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets" delete_url = "/apis/settings.k8s.io/v1alpha1/namespaces/{namespace}/podpresets/{name}" @@ -45,7 +46,7 @@ class Meta: watch_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets/{name}" watchlist_all_url = "/apis/settings.k8s.io/v1alpha1/watch/podpresets" watchlist_ns_url = "/apis/settings.k8s.io/v1alpha1/watch/namespaces/{namespace}/podpresets" - + apiVersion = Field(six.text_type, "settings.k8s.io/v1alpha1") kind = Field(six.text_type, "PodPreset") @@ -62,4 +63,3 @@ class PodPresetList(Model): items = ListField(PodPreset) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/storage/v1.py b/k8s/models/v1_9/api/storage/v1.py index 5d51b0c..33f4173 100644 --- a/k8s/models/v1_9/api/storage/v1.py +++ b/k8s/models/v1_9/api/storage/v1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1/storageclasses" delete_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1") kind = Field(six.text_type, "StorageClass") @@ -56,4 +57,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/storage/v1alpha1.py b/k8s/models/v1_9/api/storage/v1alpha1.py index 8141a20..81383ed 100644 --- a/k8s/models/v1_9/api/storage/v1alpha1.py +++ b/k8s/models/v1_9/api/storage/v1alpha1.py @@ -66,6 +66,7 @@ class VolumeAttachment(Model): VolumeAttachment objects are non-namespaced. """ + class Meta: create_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments" delete_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" @@ -74,7 +75,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}" watch_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1alpha1/watch/volumeattachments" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1alpha1") kind = Field(six.text_type, "VolumeAttachment") @@ -92,4 +93,3 @@ class VolumeAttachmentList(Model): items = ListField(VolumeAttachment) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/api/storage/v1beta1.py b/k8s/models/v1_9/api/storage/v1beta1.py index b155af2..ad427e6 100644 --- a/k8s/models/v1_9/api/storage/v1beta1.py +++ b/k8s/models/v1_9/api/storage/v1beta1.py @@ -26,6 +26,7 @@ class StorageClass(Model): namespaced; the name of the storage class according to etcd is in ObjectMeta.Name. """ + class Meta: create_url = "/apis/storage.k8s.io/v1beta1/storageclasses" delete_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" @@ -34,7 +35,7 @@ class Meta: update_url = "/apis/storage.k8s.io/v1beta1/storageclasses/{name}" watch_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses/{name}" watchlist_all_url = "/apis/storage.k8s.io/v1beta1/watch/storageclasses" - + apiVersion = Field(six.text_type, "storage.k8s.io/v1beta1") kind = Field(six.text_type, "StorageClass") @@ -56,4 +57,3 @@ class StorageClassList(Model): items = ListField(StorageClass) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py index ffc2b10..533fa60 100644 --- a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -90,6 +90,7 @@ class CustomResourceDefinition(Model): CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>. """ + class Meta: create_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions" delete_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" @@ -98,7 +99,7 @@ class Meta: update_url = "/apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/{name}" watch_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions/{name}" watchlist_all_url = "/apis/apiextensions.k8s.io/v1beta1/watch/customresourcedefinitions" - + apiVersion = Field(six.text_type, "apiextensions.k8s.io/v1beta1") kind = Field(six.text_type, "CustomResourceDefinition") @@ -116,4 +117,3 @@ class CustomResourceDefinitionList(Model): items = ListField(CustomResourceDefinition) metadata = Field(ListMeta) - diff --git a/k8s/models/v1_9/apimachinery/apis/meta/v1.py b/k8s/models/v1_9/apimachinery/apis/meta/v1.py index 4c71480..fbe25a0 100644 --- a/k8s/models/v1_9/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_9/apimachinery/apis/meta/v1.py @@ -265,4 +265,3 @@ class APIResourceList(Model): groupVersion = RequiredField(six.text_type) resources = ListField(APIResource) - diff --git a/k8s/models/v1_9/apimachinery/runtime.py b/k8s/models/v1_9/apimachinery/runtime.py index e483edb..e53a753 100644 --- a/k8s/models/v1_9/apimachinery/runtime.py +++ b/k8s/models/v1_9/apimachinery/runtime.py @@ -63,4 +63,3 @@ class RawExtension(Model): """ Raw = RequiredField(six.text_type) - diff --git a/k8s/models/v1_9/apimachinery/version.py b/k8s/models/v1_9/apimachinery/version.py index 522b6b7..578c91e 100644 --- a/k8s/models/v1_9/apimachinery/version.py +++ b/k8s/models/v1_9/apimachinery/version.py @@ -31,4 +31,3 @@ class Info(Model): major = RequiredField(six.text_type) minor = RequiredField(six.text_type) platform = RequiredField(six.text_type) - diff --git a/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py index 0a47379..645c942 100644 --- a/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py +++ b/k8s/models/v1_9/kube_aggregator/apis/apiregistration/v1beta1.py @@ -69,6 +69,7 @@ class APIService(Model): APIService represents a server for a particular GroupVersion. Name must be 'version.group'. """ + class Meta: create_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices" delete_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" @@ -77,7 +78,7 @@ class Meta: update_url = "/apis/apiregistration.k8s.io/v1beta1/apiservices/{name}" watch_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices/{name}" watchlist_all_url = "/apis/apiregistration.k8s.io/v1beta1/watch/apiservices" - + apiVersion = Field(six.text_type, "apiregistration.k8s.io/v1beta1") kind = Field(six.text_type, "APIService") @@ -95,4 +96,3 @@ class APIServiceList(Model): items = ListField(APIService) metadata = Field(ListMeta) - From 0220344d57472af60a1ba6665fe1772300feab00 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Fri, 11 Jan 2019 14:43:57 +0100 Subject: [PATCH 23/25] apiVersion and kind can be regular fields on non-top-level models --- bin/model.jinja2 | 7 +++++-- k8s/models/v1_10/api/autoscaling/v1.py | 2 ++ k8s/models/v1_10/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_10/api/core/v1.py | 4 ++++ k8s/models/v1_10/api/rbac/v1.py | 2 ++ k8s/models/v1_10/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_10/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_10/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_11/api/autoscaling/v1.py | 2 ++ k8s/models/v1_11/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_11/api/core/v1.py | 4 ++++ k8s/models/v1_11/api/rbac/v1.py | 2 ++ k8s/models/v1_11/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_11/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_11/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_12/api/autoscaling/v1.py | 2 ++ k8s/models/v1_12/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_12/api/autoscaling/v2beta2.py | 2 ++ k8s/models/v1_12/api/core/v1.py | 5 +++++ k8s/models/v1_12/api/rbac/v1.py | 2 ++ k8s/models/v1_12/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_12/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_12/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_13/api/autoscaling/v1.py | 2 ++ k8s/models/v1_13/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_13/api/autoscaling/v2beta2.py | 2 ++ k8s/models/v1_13/api/core/v1.py | 5 +++++ k8s/models/v1_13/api/rbac/v1.py | 2 ++ k8s/models/v1_13/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_13/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_13/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_6/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_6/kubernetes/api/v1.py | 3 +++ k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py | 2 ++ k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py | 2 ++ k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py | 3 +++ k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py | 2 ++ k8s/models/v1_7/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_7/kubernetes/api/v1.py | 4 ++++ k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py | 2 ++ k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py | 2 ++ k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py | 3 +++ k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py | 2 ++ k8s/models/v1_8/api/autoscaling/v1.py | 2 ++ k8s/models/v1_8/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_8/api/core/v1.py | 4 ++++ k8s/models/v1_8/api/rbac/v1.py | 2 ++ k8s/models/v1_8/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_8/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_8/apimachinery/apis/meta/v1.py | 4 ++++ k8s/models/v1_9/api/autoscaling/v1.py | 2 ++ k8s/models/v1_9/api/autoscaling/v2beta1.py | 2 ++ k8s/models/v1_9/api/core/v1.py | 4 ++++ k8s/models/v1_9/api/rbac/v1.py | 2 ++ k8s/models/v1_9/api/rbac/v1alpha1.py | 3 +++ k8s/models/v1_9/api/rbac/v1beta1.py | 2 ++ .../apiextensions_apiserver/apis/apiextensions/v1beta1.py | 1 + k8s/models/v1_9/apimachinery/apis/meta/v1.py | 4 ++++ 63 files changed, 164 insertions(+), 2 deletions(-) diff --git a/bin/model.jinja2 b/bin/model.jinja2 index c063c8b..98d2435 100644 --- a/bin/model.jinja2 +++ b/bin/model.jinja2 @@ -36,11 +36,14 @@ class {{ model.definition.name }}(Model): {% set gvk = model.definition.gvks[-1] %} apiVersion = Field(six.text_type, "{{ [gvk.group, gvk.version]|select|join("/") }}") kind = Field(six.text_type, "{{ gvk.kind }}") -{% endif %} {% for field in model.definition.fields|rejectattr("name", "in", ("apiVersion", "kind"))|sort %} {{ field.name }} = {{ field.cls }}({{ field.type.name }}{% if field.alt_type %}, alt_type={{ field.alt_type.name }}{% endif %}) +{% endfor %} {% else %} - # Model has no fields + +{% for field in model.definition.fields|sort %} + {{ field.name }} = {{ field.cls }}({{ field.type.name }}{% if field.alt_type %}, alt_type={{ field.alt_type.name }}{% endif %}) {% endfor %} +{% endif %} {% endfor %} diff --git a/k8s/models/v1_10/api/autoscaling/v1.py b/k8s/models/v1_10/api/autoscaling/v1.py index cbe3c62..e29ded4 100644 --- a/k8s/models/v1_10/api/autoscaling/v1.py +++ b/k8s/models/v1_10/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_10/api/autoscaling/v2beta1.py b/k8s/models/v1_10/api/autoscaling/v2beta1.py index bcead4d..f081993 100644 --- a/k8s/models/v1_10/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_10/api/autoscaling/v2beta1.py @@ -115,6 +115,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_10/api/core/v1.py b/k8s/models/v1_10/api/core/v1.py index cf8e5c8..b91e6eb 100644 --- a/k8s/models/v1_10/api/core/v1.py +++ b/k8s/models/v1_10/api/core/v1.py @@ -596,7 +596,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -672,6 +674,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -1921,6 +1924,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_10/api/rbac/v1.py b/k8s/models/v1_10/api/rbac/v1.py index 1febf86..7623c7b 100644 --- a/k8s/models/v1_10/api/rbac/v1.py +++ b/k8s/models/v1_10/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_10/api/rbac/v1alpha1.py b/k8s/models/v1_10/api/rbac/v1alpha1.py index 8b0b9ce..f30261f 100644 --- a/k8s/models/v1_10/api/rbac/v1alpha1.py +++ b/k8s/models/v1_10/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_10/api/rbac/v1beta1.py b/k8s/models/v1_10/api/rbac/v1beta1.py index 1bb38b1..474de8a 100644 --- a/k8s/models/v1_10/api/rbac/v1beta1.py +++ b/k8s/models/v1_10/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 0277302..f1b0909 100644 --- a/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_10/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -65,6 +65,7 @@ class CustomResourceDefinitionNames(Model): """ categories = ListField(six.text_type) + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_10/apimachinery/apis/meta/v1.py b/k8s/models/v1_10/apimachinery/apis/meta/v1.py index 96585d6..d62d674 100644 --- a/k8s/models/v1_10/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_10/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -108,8 +109,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -246,6 +249,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_11/api/autoscaling/v1.py b/k8s/models/v1_11/api/autoscaling/v1.py index cf205c2..82ba216 100644 --- a/k8s/models/v1_11/api/autoscaling/v1.py +++ b/k8s/models/v1_11/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_11/api/autoscaling/v2beta1.py b/k8s/models/v1_11/api/autoscaling/v2beta1.py index 4a148d5..931010a 100644 --- a/k8s/models/v1_11/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_11/api/autoscaling/v2beta1.py @@ -115,6 +115,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_11/api/core/v1.py b/k8s/models/v1_11/api/core/v1.py index d127ac8..88600fd 100644 --- a/k8s/models/v1_11/api/core/v1.py +++ b/k8s/models/v1_11/api/core/v1.py @@ -683,7 +683,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -735,6 +737,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -2041,6 +2044,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_11/api/rbac/v1.py b/k8s/models/v1_11/api/rbac/v1.py index 73d6d20..5061906 100644 --- a/k8s/models/v1_11/api/rbac/v1.py +++ b/k8s/models/v1_11/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_11/api/rbac/v1alpha1.py b/k8s/models/v1_11/api/rbac/v1alpha1.py index dae825a..70f6a01 100644 --- a/k8s/models/v1_11/api/rbac/v1alpha1.py +++ b/k8s/models/v1_11/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_11/api/rbac/v1beta1.py b/k8s/models/v1_11/api/rbac/v1beta1.py index a46504a..27ef7e6 100644 --- a/k8s/models/v1_11/api/rbac/v1beta1.py +++ b/k8s/models/v1_11/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 57b8fb2..d6b83c9 100644 --- a/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_11/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -75,6 +75,7 @@ class CustomResourceDefinitionNames(Model): """ categories = ListField(six.text_type) + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_11/apimachinery/apis/meta/v1.py b/k8s/models/v1_11/apimachinery/apis/meta/v1.py index 3b785ff..3c6467b 100644 --- a/k8s/models/v1_11/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_11/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -108,8 +109,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -246,6 +249,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_12/api/autoscaling/v1.py b/k8s/models/v1_12/api/autoscaling/v1.py index 76bfa16..cfc662b 100644 --- a/k8s/models/v1_12/api/autoscaling/v1.py +++ b/k8s/models/v1_12/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/api/autoscaling/v2beta1.py b/k8s/models/v1_12/api/autoscaling/v2beta1.py index 03d9ca4..5b1c421 100644 --- a/k8s/models/v1_12/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_12/api/autoscaling/v2beta1.py @@ -117,6 +117,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/api/autoscaling/v2beta2.py b/k8s/models/v1_12/api/autoscaling/v2beta2.py index a698d6f..7c9ec81 100644 --- a/k8s/models/v1_12/api/autoscaling/v2beta2.py +++ b/k8s/models/v1_12/api/autoscaling/v2beta2.py @@ -139,6 +139,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/api/core/v1.py b/k8s/models/v1_12/api/core/v1.py index a38b899..da8b35f 100644 --- a/k8s/models/v1_12/api/core/v1.py +++ b/k8s/models/v1_12/api/core/v1.py @@ -58,6 +58,7 @@ class TypedLocalObjectReference(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) @@ -694,7 +695,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -746,6 +749,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -2054,6 +2058,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_12/api/rbac/v1.py b/k8s/models/v1_12/api/rbac/v1.py index c2a4c47..2dfcba5 100644 --- a/k8s/models/v1_12/api/rbac/v1.py +++ b/k8s/models/v1_12/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/api/rbac/v1alpha1.py b/k8s/models/v1_12/api/rbac/v1alpha1.py index b0ab132..a3ceb9d 100644 --- a/k8s/models/v1_12/api/rbac/v1alpha1.py +++ b/k8s/models/v1_12/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/api/rbac/v1beta1.py b/k8s/models/v1_12/api/rbac/v1beta1.py index b580ab1..c6ae690 100644 --- a/k8s/models/v1_12/api/rbac/v1beta1.py +++ b/k8s/models/v1_12/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py index ad4b5a8..af549c0 100644 --- a/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_12/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -75,6 +75,7 @@ class CustomResourceDefinitionNames(Model): """ categories = ListField(six.text_type) + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_12/apimachinery/apis/meta/v1.py b/k8s/models/v1_12/apimachinery/apis/meta/v1.py index 2e812bd..be2f70f 100644 --- a/k8s/models/v1_12/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_12/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -109,8 +110,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -247,6 +250,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_13/api/autoscaling/v1.py b/k8s/models/v1_13/api/autoscaling/v1.py index d8b3bc8..926f73d 100644 --- a/k8s/models/v1_13/api/autoscaling/v1.py +++ b/k8s/models/v1_13/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/api/autoscaling/v2beta1.py b/k8s/models/v1_13/api/autoscaling/v2beta1.py index 559df2e..132aa1c 100644 --- a/k8s/models/v1_13/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_13/api/autoscaling/v2beta1.py @@ -117,6 +117,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/api/autoscaling/v2beta2.py b/k8s/models/v1_13/api/autoscaling/v2beta2.py index f710b62..e24357e 100644 --- a/k8s/models/v1_13/api/autoscaling/v2beta2.py +++ b/k8s/models/v1_13/api/autoscaling/v2beta2.py @@ -139,6 +139,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/api/core/v1.py b/k8s/models/v1_13/api/core/v1.py index bd6ecb1..3a31a4d 100644 --- a/k8s/models/v1_13/api/core/v1.py +++ b/k8s/models/v1_13/api/core/v1.py @@ -58,6 +58,7 @@ class TypedLocalObjectReference(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) @@ -694,7 +695,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -746,6 +749,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -2066,6 +2070,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_13/api/rbac/v1.py b/k8s/models/v1_13/api/rbac/v1.py index abb9d7b..87c8b19 100644 --- a/k8s/models/v1_13/api/rbac/v1.py +++ b/k8s/models/v1_13/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/api/rbac/v1alpha1.py b/k8s/models/v1_13/api/rbac/v1alpha1.py index 7464133..0cf7906 100644 --- a/k8s/models/v1_13/api/rbac/v1alpha1.py +++ b/k8s/models/v1_13/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/api/rbac/v1beta1.py b/k8s/models/v1_13/api/rbac/v1beta1.py index 317f5e0..5b194c7 100644 --- a/k8s/models/v1_13/api/rbac/v1beta1.py +++ b/k8s/models/v1_13/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py index e5ede77..0654b5f 100644 --- a/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_13/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -96,6 +96,7 @@ class CustomResourceDefinitionNames(Model): """ categories = ListField(six.text_type) + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_13/apimachinery/apis/meta/v1.py b/k8s/models/v1_13/apimachinery/apis/meta/v1.py index 4bb0e41..19a042f 100644 --- a/k8s/models/v1_13/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_13/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -109,8 +110,10 @@ class OwnerReference(Model): cluster-scoped, so there is no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -247,6 +250,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_6/apimachinery/apis/meta/v1.py b/k8s/models/v1_6/apimachinery/apis/meta/v1.py index 71f3bf9..73342b5 100644 --- a/k8s/models/v1_6/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_6/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) @@ -107,8 +108,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -224,6 +227,7 @@ class APIResource(Model): APIResource specifies the name of a resource and whether it is namespaced. """ + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/api/v1.py b/k8s/models/v1_6/kubernetes/api/v1.py index 0b4072a..9cfba47 100644 --- a/k8s/models/v1_6/kubernetes/api/v1.py +++ b/k8s/models/v1_6/kubernetes/api/v1.py @@ -470,7 +470,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -505,6 +507,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py index 56ec474..444ead8 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py index 601f288..b9d250a 100644 --- a/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/autoscaling/v2alpha1.py @@ -76,6 +76,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py index 3dec7f5..6271050 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py index 31a9824..9bbbce0 100644 --- a/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_6/kubernetes/apis/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/apimachinery/apis/meta/v1.py b/k8s/models/v1_7/apimachinery/apis/meta/v1.py index 2739c14..9d440e4 100644 --- a/k8s/models/v1_7/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_7/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -108,8 +109,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -244,6 +247,7 @@ class APIResource(Model): """ categories = ListField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_7/kubernetes/api/v1.py b/k8s/models/v1_7/kubernetes/api/v1.py index a287b4d..1db7f4a 100644 --- a/k8s/models/v1_7/kubernetes/api/v1.py +++ b/k8s/models/v1_7/kubernetes/api/v1.py @@ -474,7 +474,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -526,6 +528,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -1692,6 +1695,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py index b6ac85c..4783887 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py index d36de59..764fdf5 100644 --- a/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/autoscaling/v2alpha1.py @@ -89,6 +89,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py index e5767d6..e51573e 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py index 04d56b6..4dd26c8 100644 --- a/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py +++ b/k8s/models/v1_7/kubernetes/apis/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/api/autoscaling/v1.py b/k8s/models/v1_8/api/autoscaling/v1.py index 8f21343..a6abda0 100644 --- a/k8s/models/v1_8/api/autoscaling/v1.py +++ b/k8s/models/v1_8/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/api/autoscaling/v2beta1.py b/k8s/models/v1_8/api/autoscaling/v2beta1.py index ca45803..33368af 100644 --- a/k8s/models/v1_8/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_8/api/autoscaling/v2beta1.py @@ -89,6 +89,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/api/core/v1.py b/k8s/models/v1_8/api/core/v1.py index ba9cc27..bf7d314 100644 --- a/k8s/models/v1_8/api/core/v1.py +++ b/k8s/models/v1_8/api/core/v1.py @@ -500,7 +500,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -576,6 +578,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -1795,6 +1798,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_8/api/rbac/v1.py b/k8s/models/v1_8/api/rbac/v1.py index 11bab11..cd8c2f7 100644 --- a/k8s/models/v1_8/api/rbac/v1.py +++ b/k8s/models/v1_8/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/api/rbac/v1alpha1.py b/k8s/models/v1_8/api/rbac/v1alpha1.py index e2b48ed..9359753 100644 --- a/k8s/models/v1_8/api/rbac/v1alpha1.py +++ b/k8s/models/v1_8/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/api/rbac/v1beta1.py b/k8s/models/v1_8/api/rbac/v1beta1.py index 05016ec..bbf48a4 100644 --- a/k8s/models/v1_8/api/rbac/v1beta1.py +++ b/k8s/models/v1_8/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 6a01b44..a629333 100644 --- a/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_8/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -43,6 +43,7 @@ class CustomResourceDefinitionNames(Model): CustomResourceDefinition """ + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_8/apimachinery/apis/meta/v1.py b/k8s/models/v1_8/apimachinery/apis/meta/v1.py index 40225c4..2bb3ffb 100644 --- a/k8s/models/v1_8/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_8/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -108,8 +109,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -246,6 +249,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_9/api/autoscaling/v1.py b/k8s/models/v1_9/api/autoscaling/v1.py index 7d66516..f5f0465 100644 --- a/k8s/models/v1_9/api/autoscaling/v1.py +++ b/k8s/models/v1_9/api/autoscaling/v1.py @@ -66,6 +66,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_9/api/autoscaling/v2beta1.py b/k8s/models/v1_9/api/autoscaling/v2beta1.py index 5ed4b01..58380d0 100644 --- a/k8s/models/v1_9/api/autoscaling/v2beta1.py +++ b/k8s/models/v1_9/api/autoscaling/v2beta1.py @@ -89,6 +89,8 @@ class CrossVersionObjectReference(Model): referred resource. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_9/api/core/v1.py b/k8s/models/v1_9/api/core/v1.py index 2d803d4..eb56a62 100644 --- a/k8s/models/v1_9/api/core/v1.py +++ b/k8s/models/v1_9/api/core/v1.py @@ -566,7 +566,9 @@ class ObjectReference(Model): referred object. """ + apiVersion = Field(six.text_type) fieldPath = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) namespace = Field(six.text_type) resourceVersion = Field(six.text_type) @@ -642,6 +644,7 @@ class ObjectFieldSelector(Model): ObjectFieldSelector selects an APIVersioned field of an object. """ + apiVersion = Field(six.text_type) fieldPath = RequiredField(six.text_type) @@ -1889,6 +1892,7 @@ class AzureDiskVolumeSource(Model): diskName = RequiredField(six.text_type) diskURI = RequiredField(six.text_type) fsType = Field(six.text_type) + kind = Field(six.text_type) readOnly = Field(bool) diff --git a/k8s/models/v1_9/api/rbac/v1.py b/k8s/models/v1_9/api/rbac/v1.py index 4c65a7c..eaf7805 100644 --- a/k8s/models/v1_9/api/rbac/v1.py +++ b/k8s/models/v1_9/api/rbac/v1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_9/api/rbac/v1alpha1.py b/k8s/models/v1_9/api/rbac/v1alpha1.py index c825333..4192656 100644 --- a/k8s/models/v1_9/api/rbac/v1alpha1.py +++ b/k8s/models/v1_9/api/rbac/v1alpha1.py @@ -24,6 +24,8 @@ class Subject(Model): non-objects such as user and group names. """ + apiVersion = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -34,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_9/api/rbac/v1beta1.py b/k8s/models/v1_9/api/rbac/v1beta1.py index ee751e8..5edbe57 100644 --- a/k8s/models/v1_9/api/rbac/v1beta1.py +++ b/k8s/models/v1_9/api/rbac/v1beta1.py @@ -25,6 +25,7 @@ class Subject(Model): """ apiGroup = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespace = Field(six.text_type) @@ -35,6 +36,7 @@ class RoleRef(Model): """ apiGroup = RequiredField(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) diff --git a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py index 533fa60..ace5fb1 100644 --- a/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py +++ b/k8s/models/v1_9/apiextensions_apiserver/apis/apiextensions/v1beta1.py @@ -43,6 +43,7 @@ class CustomResourceDefinitionNames(Model): CustomResourceDefinition """ + kind = RequiredField(six.text_type) listKind = Field(six.text_type) plural = RequiredField(six.text_type) shortNames = ListField(six.text_type) diff --git a/k8s/models/v1_9/apimachinery/apis/meta/v1.py b/k8s/models/v1_9/apimachinery/apis/meta/v1.py index fbe25a0..09829bd 100644 --- a/k8s/models/v1_9/apimachinery/apis/meta/v1.py +++ b/k8s/models/v1_9/apimachinery/apis/meta/v1.py @@ -52,6 +52,7 @@ class StatusDetails(Model): causes = ListField(StatusCause) group = Field(six.text_type) + kind = Field(six.text_type) name = Field(six.text_type) retryAfterSeconds = Field(int) uid = Field(six.text_type) @@ -108,8 +109,10 @@ class OwnerReference(Model): no namespace field. """ + apiVersion = RequiredField(six.text_type) blockOwnerDeletion = Field(bool) controller = Field(bool) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) uid = RequiredField(six.text_type) @@ -246,6 +249,7 @@ class APIResource(Model): categories = ListField(six.text_type) group = Field(six.text_type) + kind = RequiredField(six.text_type) name = RequiredField(six.text_type) namespaced = RequiredField(bool) shortNames = ListField(six.text_type) From c0ea719b886f3e3013b39d4a1fb9742f746db335 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 14 Jan 2019 10:04:06 +0100 Subject: [PATCH 24/25] Fix codestyle issue --- k8s/models/enums.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/models/enums.py b/k8s/models/enums.py index d7f4ae4..6829ab3 100644 --- a/k8s/models/enums.py +++ b/k8s/models/enums.py @@ -2,11 +2,11 @@ # -*- coding: utf-8 -def _Enum(name, attrs): +def _make_enum(name, attrs): return type(name, (object,), {a: a for a in attrs}) -ResourceQuotaScope = _Enum("ResourceQuota", ( +ResourceQuotaScope = _make_enum("ResourceQuotaScope", ( "Terminating", "NotTerminating", "BestEffort", From 8b33cd0e74f091c9cac08ee810ce79e5e860e3c4 Mon Sep 17 00:00:00 2001 From: Morten Lied Johansen Date: Mon, 14 Jan 2019 10:10:33 +0100 Subject: [PATCH 25/25] Omit generated code from code coverage reports --- setup.cfg | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.cfg b/setup.cfg index 3511a77..b0794db 100644 --- a/setup.cfg +++ b/setup.cfg @@ -4,6 +4,9 @@ test=pytest [tool:pytest] addopts = --junitxml=build/reports/tests/junit.xml --cov=k8s --cov-report html --cov-report term --cov-report xml +[coverage:run] +omit=k8s/models/v1_*/ + [coverage:html] directory=build/reports/coverage