class Secret(Model): class Meta: list_url = "/api/v1/secrets" url_template = "/api/v1/namespaces/{namespace}/secrets/{name}" metadata = Field(ObjectMeta) data = Field(dict) type = Field(six.text_type)
class FiaasApplicationStatus(Model): class Meta: url_template = "/apis/fiaas.schibsted.io/v1/namespaces/{namespace}/application-statuses/{name}" # Workaround for https://github.com/kubernetes/kubernetes/issues/44182 apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1") kind = Field(six.text_type, "ApplicationStatus") metadata = Field(ObjectMeta) result = Field(six.text_type) logs = ListField(six.text_type)
class PaasbetaApplication(Model): class Meta: url_template = "/apis/schibsted.io/v1beta/namespaces/{namespace}/paasbetaapplications/{name}" watch_list_url = "/apis/schibsted.io/v1beta/watch/paasbetaapplications" # Workaround for https://github.com/kubernetes/kubernetes/issues/44182 apiVersion = Field(six.text_type, "schibsted.io/v1beta") kind = Field(six.text_type, "PaasbetaApplication") metadata = Field(ObjectMeta) spec = Field(PaasbetaApplicationSpec)
class PaasbetaStatus(Model): class Meta: url_template = "/apis/schibsted.io/v1beta/namespaces/{namespace}/paasbetastatuses/{name}" # Workaround for https://github.com/kubernetes/kubernetes/issues/44182 apiVersion = Field(six.text_type, "schibsted.io/v1beta") kind = Field(six.text_type, "PaasbetaStatus") metadata = Field(ObjectMeta) result = Field(six.text_type) logs = ListField(six.text_type)
class FiaasStatus(Model): """Deprecated. This model will be removed as soon as migration to ApplicationStatus is complete""" class Meta: url_template = "/apis/fiaas.schibsted.io/v1/namespaces/{namespace}/statuses/{name}" # Workaround for https://github.com/kubernetes/kubernetes/issues/44182 apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1") kind = Field(six.text_type, "Status") metadata = Field(ObjectMeta) result = Field(six.text_type) logs = ListField(six.text_type)
class ModelTest(Model): class Meta: pass 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) _exec = Field(int)
class FiaasApplication(Model): class Meta: url_template = "/apis/fiaas.schibsted.io/v1/namespaces/{namespace}/applications/{name}" watch_list_url = "/apis/fiaas.schibsted.io/v1/watch/applications" list_url = "/apis/fiaas.schibsted.io/v1/applications" # Workaround for https://github.com/kubernetes/kubernetes/issues/44182 apiVersion = Field(six.text_type, "fiaas.schibsted.io/v1") kind = Field(six.text_type, "Application") metadata = Field(ObjectMeta) spec = Field(FiaasApplicationSpec)
class ApplicationTopic(Model): """Maps Application to the topics it produces to or consumes from""" class Meta: list_url = "/apis/kafkarator.nais.io/v1/application-topic" url_template = "/apis/kafkarator.nais.io/v1/namespaces/{namespace}/application-topic/{name}" watch_list_url = "/apis/kafkarator.nais.io/v1/watch/application-topics" watch_list_url_template = "/apis/kafkarator.nais.io/v1/watch/namespaces/{namespace}/application-topics" apiVersion = Field(str, "kafkarator.nais.io/v1") kind = Field(str, "ApplicationTopic") metadata = Field(ObjectMeta) spec = Field(ApplicationTopicSpec)
class TopicAccess(Model): """Manages access to a topic""" class Meta: list_url = "/apis/kafkarator.nais.io/v1/topic-access" url_template = "/apis/kafkarator.nais.io/v1/namespaces/{namespace}/topic-access/{name}" watch_list_url = "/apis/kafkarator.nais.io/v1/watch/topic-accesses" watch_list_url_template = "/apis/kafkarator.nais.io/v1/watch/namespaces/{namespace}/topic-accesses" apiVersion = Field(str, "kafkarator.nais.io/v1") kind = Field(str, "TopicAccess") metadata = Field(ObjectMeta) spec = Field(TopicAccessSpec)
class Topic(Model): """Configures a topic""" class Meta: list_url = "/apis/kafkarator.nais.io/v1/topic" url_template = "/apis/kafkarator.nais.io/v1/namespaces/{namespace}/topic/{name}" watch_list_url = "/apis/kafkarator.nais.io/v1/watch/topics" watch_list_url_template = "/apis/kafkarator.nais.io/v1/watch/namespaces/{namespace}/topics" apiVersion = Field(str, "kafkarator.nais.io/v1") kind = Field(str, "Topic") metadata = Field(ObjectMeta) spec = Field(TopicSpec)
class AdditionalLabelsOrAnnotations(Model): _global = Field(dict) deployment = Field(dict) horizontal_pod_autoscaler = Field(dict) ingress = Field(dict) service = Field(dict) pod = Field(dict) status = Field(dict)
class ApplicationTopicSpec(Model): application = Field(str) produces = ListField(TopicReference) consumes = ListField(TopicReference)
class TopicReference(Model): name = Field(str) namespace = Field(str) cluster = Field(str)
class TopicAccessSpec(Model): topic = Field(TopicReference) granted = Field(TopicAccessUsers) requested = Field(TopicAccessUsers)
class TopicSpec(Model): name = Field(str) config = Field(dict)
class FiaasApplicationSpec(Model): application = RequiredField(six.text_type) image = RequiredField(six.text_type) config = RequiredField(dict) additional_labels = Field(AdditionalLabelsOrAnnotations) additional_annotations = Field(AdditionalLabelsOrAnnotations)
class RequiredFieldTest(Model): required_field = RequiredField(int) field = Field(int, 100)