From 4b87a4b7c4877659d17881af0e068ed6e75acce7 Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 30 May 2019 09:29:55 +0000 Subject: [PATCH 1/8] Add flavor schema --- indigo-schema-couch/schemas/flavor.js | 68 ++++++++++++++++++++++++++ indigo-schema-couch/schemas/service.js | 3 +- 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 indigo-schema-couch/schemas/flavor.js diff --git a/indigo-schema-couch/schemas/flavor.js b/indigo-schema-couch/schemas/flavor.js new file mode 100644 index 0000000..52d34b3 --- /dev/null +++ b/indigo-schema-couch/schemas/flavor.js @@ -0,0 +1,68 @@ +module.exports = { + type: "object", + additionalProperties: true, + list: { + filters: { + flavor_name: ["flavor_name"], + service: ["service"] + }, + value: { + flavor_id: "flavor_id", + flavor_name: "flavor_name" + } + }, + belongs_to: [{ + type: 'service', + many_name: 'flavors', + foreign_key: 'service', + value: { + flavor_id: "flavor_id", + flavor_name: "flavor_name", + service: "service" + } + }], + properties: { + flavor_id: { + type: "string", + required: true + }, + flavor_name: { + type: "string", + required: true + }, + ram: { + type: "integer", + required: false + }, + disk: { + type: "integer", + required: false + }, + num_vcpus: { + type: "integer", + required: false + }, + num_gpus: { + type: "integer", + required: false + }, + gpu_model: { + type: ["string", "null"], + required: false + }, + gpu_vendor: { + type: ["string", "null"], + required: false + }, + tenant_id: { + type: "string", + required: true + }, + service: { + type: "string", + required: true + } + } +} + + diff --git a/indigo-schema-couch/schemas/service.js b/indigo-schema-couch/schemas/service.js index b95aac4..f7672fd 100644 --- a/indigo-schema-couch/schemas/service.js +++ b/indigo-schema-couch/schemas/service.js @@ -16,7 +16,8 @@ module.exports = { } }, has_many: [ - { name: 'images', type: 'image' } + { name: 'images', type: 'image' }, + { name: 'flavors', type: 'flavor' } ], belongs_to: [{ type: 'provider', From 3bb250f1fc3f4fcace6f1e73c208eae493ff5706 Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 30 May 2019 10:24:06 +0000 Subject: [PATCH 2/8] Add tenant schema --- indigo-schema-couch/schemas/service.js | 3 +- indigo-schema-couch/schemas/tenant.js | 40 ++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 indigo-schema-couch/schemas/tenant.js diff --git a/indigo-schema-couch/schemas/service.js b/indigo-schema-couch/schemas/service.js index f7672fd..4b3efeb 100644 --- a/indigo-schema-couch/schemas/service.js +++ b/indigo-schema-couch/schemas/service.js @@ -17,7 +17,8 @@ module.exports = { }, has_many: [ { name: 'images', type: 'image' }, - { name: 'flavors', type: 'flavor' } + { name: 'flavors', type: 'flavor' }, + { name: 'tenants', type: 'tenant' } ], belongs_to: [{ type: 'provider', diff --git a/indigo-schema-couch/schemas/tenant.js b/indigo-schema-couch/schemas/tenant.js new file mode 100644 index 0000000..2fadf47 --- /dev/null +++ b/indigo-schema-couch/schemas/tenant.js @@ -0,0 +1,40 @@ +module.exports = { + type: "object", + additionalProperties: true, + list: { + filters: { + tenant_name: ["tenant_name"], + service: ["service"] + }, + value: { + tenant_id: "tenant_id", + tenant_name: "tenant_name" + } + }, + belongs_to: [{ + type: 'service', + many_name: 'tenants', + foreign_key: 'service', + value: { + tenant_id: "tenant_id", + tenant_name: "tenant_name", + service: "service" + } + }], + properties: { + tenant_id: { + type: "string", + required: true + }, + tenant_name: { + type: "string", + required: true + }, + service: { + type: "string", + required: true + } + } +} + + From 050bc8e5c40f8929eeafef017e96801658378d2e Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 22 Aug 2019 12:54:56 +0200 Subject: [PATCH 3/8] Fix: images and flavors dependant of tenant entity (instead of service) --- indigo-schema-couch/schemas/flavor.js | 18 +++++++++++++----- indigo-schema-couch/schemas/image.js | 18 +++++++++++++----- indigo-schema-couch/schemas/tenant.js | 4 ++++ 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/indigo-schema-couch/schemas/flavor.js b/indigo-schema-couch/schemas/flavor.js index 52d34b3..e219a79 100644 --- a/indigo-schema-couch/schemas/flavor.js +++ b/indigo-schema-couch/schemas/flavor.js @@ -4,7 +4,7 @@ module.exports = { list: { filters: { flavor_name: ["flavor_name"], - service: ["service"] + tenant: ["tenant"] }, value: { flavor_id: "flavor_id", @@ -12,13 +12,13 @@ module.exports = { } }, belongs_to: [{ - type: 'service', + type: 'tenant', many_name: 'flavors', - foreign_key: 'service', + foreign_key: 'tenant_id', value: { flavor_id: "flavor_id", flavor_name: "flavor_name", - service: "service" + tenant: "tenant" } }], properties: { @@ -58,9 +58,17 @@ module.exports = { type: "string", required: true }, - service: { + tenant_id: { type: "string", required: true + }, + tenant_name: { + type: "string", + required: false + }, + service: { + type: "string", + required: false } } } diff --git a/indigo-schema-couch/schemas/image.js b/indigo-schema-couch/schemas/image.js index 6a3d1ba..9e775e3 100644 --- a/indigo-schema-couch/schemas/image.js +++ b/indigo-schema-couch/schemas/image.js @@ -4,7 +4,7 @@ module.exports = { list: { filters: { image_name: ["image_name"], - service: ["service"] + tenant: ["tenant"] }, value: { image_id: "image_id", @@ -12,13 +12,13 @@ module.exports = { } }, belongs_to: [{ - type: 'service', + type: 'tenant', many_name: 'images', - foreign_key: 'service', + foreign_key: 'tenant_id', value: { image_id: "image_id", image_name: "image_name", - service: "service" + tenant: "tenant" } }], properties: { @@ -46,9 +46,17 @@ module.exports = { type: "string", required: false }, - service: { + tenant_id: { type: "string", required: true + }, + tenant_name: { + type: "string", + required: false + }, + service: { + type: "string", + required: false } } } diff --git a/indigo-schema-couch/schemas/tenant.js b/indigo-schema-couch/schemas/tenant.js index 2fadf47..6098205 100644 --- a/indigo-schema-couch/schemas/tenant.js +++ b/indigo-schema-couch/schemas/tenant.js @@ -11,6 +11,10 @@ module.exports = { tenant_name: "tenant_name" } }, + has_many: [ + { name: 'images', type: 'image' } + { name: 'flavors', type: 'flavor' } + ], belongs_to: [{ type: 'service', many_name: 'tenants', From d28bb58ef5049be2a793595085a50fb47b5ba272 Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 3 Oct 2019 12:27:21 +0200 Subject: [PATCH 4/8] Fix: tenant -> tenant_id --- indigo-schema-couch/schemas/image.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indigo-schema-couch/schemas/image.js b/indigo-schema-couch/schemas/image.js index 9e775e3..2bb9da6 100644 --- a/indigo-schema-couch/schemas/image.js +++ b/indigo-schema-couch/schemas/image.js @@ -4,7 +4,7 @@ module.exports = { list: { filters: { image_name: ["image_name"], - tenant: ["tenant"] + tenant_id: ["tenant_id"] }, value: { image_id: "image_id", @@ -18,7 +18,7 @@ module.exports = { value: { image_id: "image_id", image_name: "image_name", - tenant: "tenant" + tenant_id: "tenant_id" } }], properties: { From 55d857ab87971d3070c3a31ad5f8931b89568d21 Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 3 Oct 2019 13:03:49 +0200 Subject: [PATCH 5/8] Add iam_organisation as new field for images&flavors --- indigo-schema-couch/schemas/flavor.js | 13 ++++++++++--- indigo-schema-couch/schemas/image.js | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/indigo-schema-couch/schemas/flavor.js b/indigo-schema-couch/schemas/flavor.js index e219a79..8471d51 100644 --- a/indigo-schema-couch/schemas/flavor.js +++ b/indigo-schema-couch/schemas/flavor.js @@ -4,11 +4,13 @@ module.exports = { list: { filters: { flavor_name: ["flavor_name"], - tenant: ["tenant"] + tenant: ["tenant"], + iam_organisation: ["iam_organisation"] }, value: { flavor_id: "flavor_id", - flavor_name: "flavor_name" + flavor_name: "flavor_name", + iam_organisation: "iam_organisation" } }, belongs_to: [{ @@ -18,7 +20,8 @@ module.exports = { value: { flavor_id: "flavor_id", flavor_name: "flavor_name", - tenant: "tenant" + tenant: "tenant", + iam_organisation: "iam_organisation" } }], properties: { @@ -66,6 +69,10 @@ module.exports = { type: "string", required: false }, + iam_organisation: { + type: "string", + required: false + }, service: { type: "string", required: false diff --git a/indigo-schema-couch/schemas/image.js b/indigo-schema-couch/schemas/image.js index 2bb9da6..5371d58 100644 --- a/indigo-schema-couch/schemas/image.js +++ b/indigo-schema-couch/schemas/image.js @@ -4,11 +4,13 @@ module.exports = { list: { filters: { image_name: ["image_name"], - tenant_id: ["tenant_id"] + tenant_id: ["tenant_id"], + iam_organisation: ["iam_organisation"] }, value: { image_id: "image_id", - image_name: "image_name" + image_name: "image_name", + iam_organisation: "iam_organisation" } }, belongs_to: [{ @@ -18,7 +20,8 @@ module.exports = { value: { image_id: "image_id", image_name: "image_name", - tenant_id: "tenant_id" + tenant_id: "tenant_id", + iam_organisation: "iam_organisation" } }], properties: { @@ -54,6 +57,10 @@ module.exports = { type: "string", required: false }, + iam_organisation: { + type: "string", + required: false + }, service: { type: "string", required: false From e74d4a97987bbe614938fa9bff5ff0ec6e47b10b Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Thu, 3 Oct 2019 13:07:07 +0200 Subject: [PATCH 6/8] Fixes in tenant entity definition --- indigo-schema-couch/schemas/flavor.js | 8 ++------ indigo-schema-couch/schemas/tenant.js | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/indigo-schema-couch/schemas/flavor.js b/indigo-schema-couch/schemas/flavor.js index 8471d51..8411428 100644 --- a/indigo-schema-couch/schemas/flavor.js +++ b/indigo-schema-couch/schemas/flavor.js @@ -4,7 +4,7 @@ module.exports = { list: { filters: { flavor_name: ["flavor_name"], - tenant: ["tenant"], + tenant_id: ["tenant_id"], iam_organisation: ["iam_organisation"] }, value: { @@ -20,7 +20,7 @@ module.exports = { value: { flavor_id: "flavor_id", flavor_name: "flavor_name", - tenant: "tenant", + tenant_id: "tenant_id", iam_organisation: "iam_organisation" } }], @@ -57,10 +57,6 @@ module.exports = { type: ["string", "null"], required: false }, - tenant_id: { - type: "string", - required: true - }, tenant_id: { type: "string", required: true diff --git a/indigo-schema-couch/schemas/tenant.js b/indigo-schema-couch/schemas/tenant.js index 6098205..72099ef 100644 --- a/indigo-schema-couch/schemas/tenant.js +++ b/indigo-schema-couch/schemas/tenant.js @@ -12,7 +12,7 @@ module.exports = { } }, has_many: [ - { name: 'images', type: 'image' } + { name: 'images', type: 'image' }, { name: 'flavors', type: 'flavor' } ], belongs_to: [{ From 746cd99f207f132e8733242321d08e9b14c97a1d Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Fri, 18 Oct 2019 12:15:59 +0200 Subject: [PATCH 7/8] Added IAM org to tenant --- indigo-schema-couch/schemas/tenant.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/indigo-schema-couch/schemas/tenant.js b/indigo-schema-couch/schemas/tenant.js index 72099ef..87eba3d 100644 --- a/indigo-schema-couch/schemas/tenant.js +++ b/indigo-schema-couch/schemas/tenant.js @@ -4,11 +4,13 @@ module.exports = { list: { filters: { tenant_name: ["tenant_name"], - service: ["service"] + service: ["service"], + iam_organisation: ["iam_organisation"] }, value: { tenant_id: "tenant_id", - tenant_name: "tenant_name" + tenant_name: "tenant_name", + iam_organisation: "iam_organisation" } }, has_many: [ @@ -22,7 +24,8 @@ module.exports = { value: { tenant_id: "tenant_id", tenant_name: "tenant_name", - service: "service" + service: "service", + iam_organisation: "iam_organisation" } }], properties: { @@ -37,6 +40,10 @@ module.exports = { service: { type: "string", required: true + }, + iam_organisation: { + type: "string", + required: false } } } From 5adf654979f51d0cf7b286711810f65f50a395d3 Mon Sep 17 00:00:00 2001 From: Pablo Orviz Date: Fri, 15 Jan 2021 13:32:12 +0100 Subject: [PATCH 8/8] iam_organisation -> user_group --- indigo-schema-couch/schemas/flavor.js | 8 ++++---- indigo-schema-couch/schemas/image.js | 8 ++++---- indigo-schema-couch/schemas/tenant.js | 18 +++++++++--------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/indigo-schema-couch/schemas/flavor.js b/indigo-schema-couch/schemas/flavor.js index 8411428..6dacdd1 100644 --- a/indigo-schema-couch/schemas/flavor.js +++ b/indigo-schema-couch/schemas/flavor.js @@ -5,12 +5,12 @@ module.exports = { filters: { flavor_name: ["flavor_name"], tenant_id: ["tenant_id"], - iam_organisation: ["iam_organisation"] + user_group: ["user_group"] }, value: { flavor_id: "flavor_id", flavor_name: "flavor_name", - iam_organisation: "iam_organisation" + user_group: "user_group" } }, belongs_to: [{ @@ -21,7 +21,7 @@ module.exports = { flavor_id: "flavor_id", flavor_name: "flavor_name", tenant_id: "tenant_id", - iam_organisation: "iam_organisation" + user_group: "user_group" } }], properties: { @@ -65,7 +65,7 @@ module.exports = { type: "string", required: false }, - iam_organisation: { + user_group: { type: "string", required: false }, diff --git a/indigo-schema-couch/schemas/image.js b/indigo-schema-couch/schemas/image.js index 5371d58..02ade9c 100644 --- a/indigo-schema-couch/schemas/image.js +++ b/indigo-schema-couch/schemas/image.js @@ -5,12 +5,12 @@ module.exports = { filters: { image_name: ["image_name"], tenant_id: ["tenant_id"], - iam_organisation: ["iam_organisation"] + user_group: ["user_group"] }, value: { image_id: "image_id", image_name: "image_name", - iam_organisation: "iam_organisation" + user_group: "user_group" } }, belongs_to: [{ @@ -21,7 +21,7 @@ module.exports = { image_id: "image_id", image_name: "image_name", tenant_id: "tenant_id", - iam_organisation: "iam_organisation" + user_group: "user_group" } }], properties: { @@ -57,7 +57,7 @@ module.exports = { type: "string", required: false }, - iam_organisation: { + user_group: { type: "string", required: false }, diff --git a/indigo-schema-couch/schemas/tenant.js b/indigo-schema-couch/schemas/tenant.js index 87eba3d..4067e85 100644 --- a/indigo-schema-couch/schemas/tenant.js +++ b/indigo-schema-couch/schemas/tenant.js @@ -1,16 +1,16 @@ module.exports = { type: "object", - additionalProperties: true, + additionalProperties: true, list: { filters: { tenant_name: ["tenant_name"], service: ["service"], - iam_organisation: ["iam_organisation"] - }, + user_group: ["user_group"] + }, value: { tenant_id: "tenant_id", tenant_name: "tenant_name", - iam_organisation: "iam_organisation" + user_group: "user_group" } }, has_many: [ @@ -22,18 +22,18 @@ module.exports = { many_name: 'tenants', foreign_key: 'service', value: { - tenant_id: "tenant_id", + tenant_id: "tenant_id", tenant_name: "tenant_name", service: "service", - iam_organisation: "iam_organisation" + user_group: "user_group" } }], properties: { - tenant_id: { + tenant_id: { type: "string", required: true }, - tenant_name: { + tenant_name: { type: "string", required: true }, @@ -41,7 +41,7 @@ module.exports = { type: "string", required: true }, - iam_organisation: { + user_group: { type: "string", required: false }