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)
Exemple #2
0
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)
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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)
Exemple #6
0
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)
Exemple #7
0
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)
Exemple #8
0
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)
Exemple #9
0
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)
Exemple #10
0
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)
Exemple #11
0
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)
Exemple #12
0
class ApplicationTopicSpec(Model):
    application = Field(str)
    produces = ListField(TopicReference)
    consumes = ListField(TopicReference)
Exemple #13
0
class TopicReference(Model):
    name = Field(str)
    namespace = Field(str)
    cluster = Field(str)
Exemple #14
0
class TopicAccessSpec(Model):
    topic = Field(TopicReference)
    granted = Field(TopicAccessUsers)
    requested = Field(TopicAccessUsers)
Exemple #15
0
class TopicSpec(Model):
    name = Field(str)
    config = Field(dict)
Exemple #16
0
class FiaasApplicationSpec(Model):
    application = RequiredField(six.text_type)
    image = RequiredField(six.text_type)
    config = RequiredField(dict)
    additional_labels = Field(AdditionalLabelsOrAnnotations)
    additional_annotations = Field(AdditionalLabelsOrAnnotations)
Exemple #17
0
class RequiredFieldTest(Model):
    required_field = RequiredField(int)
    field = Field(int, 100)