From 768b047351349f5518f7394af9a0fcdba9594589 Mon Sep 17 00:00:00 2001 From: Brendan Melville Date: Mon, 22 Aug 2016 13:53:36 -0700 Subject: [PATCH] Adding schemas to the service plan model for controller. Refs #59. Signed-off-by: Brendan Melville --- k8s/service_controller/model/schemas.go | 13 +++++++++++++ k8s/service_controller/model/service_plan.go | 1 + 2 files changed, 14 insertions(+) create mode 100644 k8s/service_controller/model/schemas.go diff --git a/k8s/service_controller/model/schemas.go b/k8s/service_controller/model/schemas.go new file mode 100644 index 00000000..a28dbead --- /dev/null +++ b/k8s/service_controller/model/schemas.go @@ -0,0 +1,13 @@ +package model + +type Schemas struct { + Instance Schema `json:"instance"` + Binding Schema `json:"binding"` +} + +// A schema consists of the schema for inputs and the schema for outputs. +// Schemas are in the form of JSON Schema v4 (http://json-schema.org/). +type Schema struct { + Inputs string `json:"inputs"` + Outputs string `json:"outputs"` +} diff --git a/k8s/service_controller/model/service_plan.go b/k8s/service_controller/model/service_plan.go index 965c9daa..c8ede990 100644 --- a/k8s/service_controller/model/service_plan.go +++ b/k8s/service_controller/model/service_plan.go @@ -7,4 +7,5 @@ type ServicePlan struct { Description string `json:"description"` Metadata interface{} `json:"metadata, omitempty"` Free bool `json:"free, omitempty"` + Schemas *Schemas `json:"schemas, omitempty"` }