string_schema = {"type": "string", "minLength": 1, "maxLength": 255}
xml_text_schema = {"type": "string", "minLength": 1, "maxLength": 1000, "pattern": "^[^']+$"}
description_schema = {"type": ["string", "null"], "maxLength": 255, "pattern": "^[^'\"]+$"}
+long_description_schema = {"type": ["string", "null"], "maxLength": 3000, "pattern": "^[^'\"]+$"}
id_schema_fake = {"type": "string", "minLength": 2, "maxLength": 36}
bool_schema = {"type": "boolean"}
null_schema = {"type": "null"}
"items": shortname_schema,
}
+description_list_schema = {
+ "type": "array",
+ "minItems": 1,
+ "items": description_schema,
+}
ns_instantiate_vdu = {
"title": "ns action instantiate input schema for vdu",
"nsName": name_schema,
"nsDescription": {"oneOf": [description_schema, null_schema]},
"nsdId": id_schema,
+ "vcaId": id_schema,
"vimAccountId": id_schema,
"wimAccountId": {"oneOf": [id_schema, bool_schema, null_schema]},
"placement-engine": string_schema,
"properties": {
"member-vnf-index": name_schema,
"vimAccountId": id_schema,
+ "vcaId": id_schema,
"vdu": {
"type": "array",
"minItems": 1,
"vim_tenant_name": name_schema,
"vim_user": shortname_schema,
"vim_password": passwd_schema,
+ "vca": id_schema,
"config": {"type": "object"}
},
"additionalProperties": False
"vim_tenant_name": name_schema,
"vim_user": shortname_schema,
"vim_password": passwd_schema,
+ "vca": id_schema,
"config": {"type": "object"}
},
"required": ["name", "vim_url", "vim_type", "vim_user", "vim_password", "vim_tenant_name"],
"description": description_schema,
"credentials": object_schema,
"vim_account": id_schema,
+ "vca_id": id_schema,
"k8s_version": string_schema,
"nets": k8scluster_nets_schema,
"namespace": name_schema,
"description": description_schema,
"credentials": object_schema,
"vim_account": id_schema,
+ "vca_id": id_schema,
"k8s_version": string_schema,
"nets": k8scluster_nets_schema,
"namespace": name_schema,
"additionalProperties": False
}
+# VCA
+vca_new_schema = {
+ "title": "vca creation input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "schema_version": schema_version,
+ "schema_type": schema_type,
+ "name": name_schema,
+ "description": description_schema,
+ "endpoints": description_list_schema,
+ "user": shortname_schema,
+ "secret": passwd_schema,
+ "cacert": long_description_schema,
+ "lxd-cloud": shortname_schema,
+ "lxd-credentials": shortname_schema,
+ "k8s-cloud": shortname_schema,
+ "k8s-credentials": shortname_schema,
+ "model-config": object_schema,
+ },
+ "required": [
+ "name",
+ "endpoints",
+ "user",
+ "secret",
+ "cacert",
+ "lxd-cloud",
+ "lxd-credentials",
+ "k8s-cloud",
+ "k8s-credentials",
+ ],
+ "additionalProperties": False,
+}
+vca_edit_schema = {
+ "title": "vca creation input schema",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "type": "object",
+ "properties": {
+ "name": name_schema,
+ "description": description_schema,
+ "endpoints": description_list_schema,
+ "port": integer1_schema,
+ "user": shortname_schema,
+ "secret": passwd_schema,
+ "cacert": long_description_schema,
+ "lxd-cloud": shortname_schema,
+ "lxd-credentials": shortname_schema,
+ "k8s-cloud": shortname_schema,
+ "k8s-credentials": shortname_schema,
+ "model-config": object_schema,
+ },
+ "additionalProperties": False,
+}
+
# K8s Repos
k8srepo_types = {"enum": ["helm-chart", "juju-bundle"]}
k8srepo_properties = {
# PROJECTS
topics_with_quota = ["vnfds", "nsds", "slice_templates", "pduds", "ns_instances", "slice_instances", "vim_accounts",
- "wim_accounts", "sdn_controllers", "k8sclusters", "k8srepos", "osmrepos", "ns_subscriptions"]
+ "wim_accounts", "sdn_controllers", "k8sclusters", "vca", "k8srepos", "osmrepos", "ns_subscriptions"]
project_new_schema = {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "New project schema for administrators",