diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.component.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.component.js index e126467770be..1f9b83abb81d 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.component.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.component.js @@ -20,6 +20,7 @@ export default { productId: '<', serviceName: '<', setMessage: '<', + goToResizeNsxEdge: '<', }, controller, template, diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.controller.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.controller.js index 8d5d11ec679e..d49f56f05f11 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.controller.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.controller.js @@ -1,5 +1,4 @@ import get from 'lodash/get'; -import capitalize from 'lodash/capitalize'; import last from 'lodash/last'; import { @@ -23,21 +22,54 @@ export default class { $onInit() { this.loading = true; + this.pollNsxTaskId = null; this.$q - .all([this.getNsxDetails(), this.checkForZertoOptionOrder()]) + .all([ + this.getNsxDetails(), + this.getNsxEdgePendingTask(), + this.checkForZertoOptionOrder(), + ]) .finally(() => { this.loading = false; }); } + $onDestroy() { + if (this.pollNsxTaskId) { + this.DedicatedCloud.stopResizeNsxTaskPoller(this.pollNsxTaskId); + } + } + + pollNsxTask(taskId) { + this.pollNsxTaskId = taskId; + this.DedicatedCloud.datacenterResizeNsxTaskPoller(this.serviceName, taskId) + .then(() => { + this.getNsxDetails(); + }) + .finally(() => { + this.pollNsxTaskId = null; + }); + } + + getNsxEdgePendingTask() { + return this.DedicatedCloud.getDatacenterPendingResizeNsxTask( + this.serviceName, + this.datacenter.model.id, + ).then((data) => { + if (data?.length > 0) { + this.pollNsxTask(data[0].taskId); + } + }); + } + getNsxDetails() { return this.DedicatedCloud.getDatacenterInfoNsxt( this.serviceName, this.datacenter.model.id, - ).then(({ data }) => { + ).then((data) => { this.datacenter.model.edgesCount = data.length; this.datacenter.model.edgesLevel = data[0]?.size - ? capitalize(data[0].size) + ? data[0].size.chatAt(0).toUpperCase() + data[0].size.slice(1) : ''; }); } diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.html b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.html index 97907d08964a..185e48093eca 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.html +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/dedicatedCloud-datacenter-dashboard.html @@ -190,9 +190,36 @@ + + + + + + + + + + + + -1; + } + + changeNsxSize() { + this.trackClick(this.TRACKING_SUFFIX.CONFIRM); + this.loading = true; + this.DedicatedCloud.resizeNsxtEdgeCluster( + this.serviceName, + this.datacenterId, + this.selectedNsxLevel, + ) + .then(() => { + this.trackPage(this.TRACKING_SUFFIX.CONFIRM_SUCCESS); + this.goBack( + this.$translate.instant('dedicatedCloud_manage_nsx_edge_success'), + ); + }) + .catch(() => { + this.setMessage( + `${this.$translate.instant( + 'dedicatedCloud_datacenter_nsx_resize_error', + )}`, + 'danger', + ); + this.trackPage(this.TRACKING_SUFFIX.CONFIRM_ERROR); + }) + .finally(() => { + this.loading = false; + }); + } +} diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.html b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.html new file mode 100644 index 000000000000..261963f27ff2 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+
+
+
+ +
+ + + + + + +
diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/index.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/index.js new file mode 100644 index 000000000000..4fab07e2110d --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges/index.js @@ -0,0 +1,20 @@ +import angular from 'angular'; + +import 'angular-translate'; +import '@ovh-ux/ui-kit'; +import '@ovh-ux/ng-translate-async-loader'; + +import component from './dedicatedCloud-datacenter-manage-nsx.component'; + +const moduleName = 'ovhManagerDedicatedCloudDatacenterManageNsxEdgeComponent'; + +angular + .module(moduleName, [ + 'ngTranslateAsyncLoader', + 'oui', + 'pascalprecht.translate', + ]) + .component('ovhManagerDedicatedCloudDatacenterManageNsxEdges', component) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/translations/Messages_fr_FR.json index 8056f37ef297..9adb317e8b75 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/translations/Messages_fr_FR.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/dashboard/translations/Messages_fr_FR.json @@ -4,6 +4,26 @@ "dedicatedCloud_nsx_edge_title": "NSX Edges", "dedicatedCloud_nsx_edge_level": "Taille Edge NSX", "dedicatedCloud_nsx_edge_quantity": "Nombre de Edge NSX", + "dedicatedCloud_nsx_edge_current_level": "Niveau actuel", + "dedicatedCloud_nsx_link_datastore_order": "Ajouter du stockage", + "dedicatedCloud_nsx_link_hosts_order": "Ajouter des hosts", + "dedicatedCloud_manage_nsx_edge_title": "Modifier les noeuds NSX Edge", + "dedicatedCloud_manage_nsx_edge_require_per_node_MEDIUM": "Medium - Taille du dispositif par nœud", + "dedicatedCloud_manage_nsx_edge_require_per_node_LARGE": "Large - Taille du dispositif par nœud", + "dedicatedCloud_manage_nsx_edge_require_per_node_XLARGE": "Extra-large - Taille du dispositif par nœud", + "dedicatedCloud_manage_nsx_edge_current_level": "Niveau actuel de NSX Edge", + "dedicatedCloud_manage_nsx_edge_success": "Votre niveau de NSX Edge a bien été modifié", + "dedicatedCloud_manage_nsx_missing_ressources": "Si une option est grisée, cela signifie que vous ne disposez pas des ressources nécessaires au sein de votre DataCentre Virtuel. Vous devez avoir les ressources CPU, mémoire et disque suffisantes pour le changement de taille de vos NSX Edge.", + "dedicatedCloud_manage_nsx_choice_title_MEDIUM": "NSX Edge moyen", + "dedicatedCloud_manage_nsx_choice_description_MEDIUM": "Convient lorsque seules les fonctionnalités L2 à L4 telles que NAT, le routage, le pare-feu L4, l'équilibreur de charge L4 sont requises et que le débit total est inférieur à 2 Gbits/s.", + "dedicatedCloud_manage_nsx_choice_footer": "{{cpu}} vCPU - {{ram}}Go RAM - {{storage}} Go", + "dedicatedCloud_manage_nsx_choice_title_LARGE": "NSX Edge large", + "dedicatedCloud_manage_nsx_choice_description_LARGE": "Convient lorsque seules les fonctionnalités L2 à L4 telles que NAT, le routage, le pare-feu L4, l'équilibreur de charge L4 sont requises et que le débit total est de 2 à 10 Gbits/s. Il est également approprié lorsque l'équilibreur de charge L7 (par exemple, le déchargement SSL) est requis.", + "dedicatedCloud_manage_nsx_choice_title_XLARGE": "NSX Edge extra-large", + "dedicatedCloud_manage_nsx_choice_description_XLARGE": "Utilisez le format très grand si vous souhaitez configurer un grand nombre d'homologues BGP avec le nœud Edge. Convient lorsque le débit total requis est de plusieurs Gbits/s pour l'équilibreur de charge L7 et le VPN.", + "dedicatedCloud_nsx_task_progress": "En cours", + "dedicatedCloud_datacenter_nsx_resize_error": "Une erreur est survenue", + "dedicatedCloud_tab_datacenter_global_information": "Par défaut, tous virtuels data centers(VDC) NSX disposent d'un cluster NSX Edge composé de 2 NSX Edge. Vous avez ensuite la possibilité de modifier la taille des Edges, vous devez disposer de ressources nécessaires pour modifier la taille ou le nombre des Edges.", "dedicatedCloud_description": "Nom", "dedicatedCloud_datacenter_delete": "Supprimer le datacentre", "dedicatedCloud_datacenter_description": "Description", diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_de_DE.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_de_DE.json index 799a23064a82..bc0ec773a607 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_de_DE.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_de_DE.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Disaster Recovery Plan (DRP)", "dedicatedCloud_datacenter_EOL_title": "Ablaufdatum der Dedicated Cloud: 30. September 2022", "dedicatedCloud_datacenter_EOL_part_1": "Im Oktober 2021 hatten wir bereits angekündigt, dass unsere Angebote der Art Dedicated Cloud auslaufen und am 30. September 2022 endgültig eingestellt werden. Dieser Schritt ist im Hinblick auf Ihre VMware-Plattformen von Bedeutung, da damit eine Verbesserung der Dienstqualität, der Performance und der Sicherheit Ihrer Cluster einhergeht. Die Hardware, die vor 2018 für die Angebote vom Typ „Dedicated Cloud“ verwendet wurde, ist nicht dazu geeignet, den höchsten Service-Level nach heutigem Stand zu gewährleisten. Außerdem ist keine Integration mit den neuen VMware-Architekturen möglich.", - "dedicatedCloud_datacenter_EOL_part_2": "Zahlreiche Kunden haben diese Migration bereits geplant und begonnen. Wir möchten dies nun auch Ihnen noch vor dem Stichtag am 30. September 2022 empfehlen." + "dedicatedCloud_datacenter_EOL_part_2": "Zahlreiche Kunden haben diese Migration bereits geplant und begonnen. Wir möchten dies nun auch Ihnen noch vor dem Stichtag am 30. September 2022 empfehlen.", + "dedicatedCloud_datacenter_resize": "Größe ändern" } diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_en_GB.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_en_GB.json index 35d191074753..2f48ef49cf2e 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_en_GB.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_en_GB.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Disaster Recovery Plan (DRP)", "dedicatedCloud_datacenter_EOL_title": "Dedicated Cloud end-of-life date: 30 September 2022", "dedicatedCloud_datacenter_EOL_part_1": "As per our announcement in October 2021, our Dedicated Cloud solutions were reaching the end of their lifecycle, and will be permanently discontinued on 30 September 2022. This step is significant for your VMware platforms as it will improve service quality, performance and security for your clusters. The hardware used for the Dedicated Cloud solutions before 2018 no longer enables us to ensure an optimal service level and integration with new modern VMware architectures.", - "dedicatedCloud_datacenter_EOL_part_2": "Following our previous communications, many customers have started this scheduling and migration process. We encourage you to do the same, so that you are fully prepared before the 30 September 2022 deadline." + "dedicatedCloud_datacenter_EOL_part_2": "Following our previous communications, many customers have started this scheduling and migration process. We encourage you to do the same, so that you are fully prepared before the 30 September 2022 deadline.", + "dedicatedCloud_datacenter_resize": "Resize" } diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_es_ES.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_es_ES.json index b65af17aaa2f..b24ad705f28f 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_es_ES.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_es_ES.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Plan de recuperación ante desastres (DRP)", "dedicatedCloud_datacenter_EOL_title": "Final del ciclo de vida de la solución Dedicated Cloud: 30 de septiembre de 2022", "dedicatedCloud_datacenter_EOL_part_1": "Como ya anunciamos en octubre de 2021, la solución Dedicated Cloud se acerca al final de su ciclo de vida, por lo que este servicio dejará de estar disponible definitivamente el próximo 30 de septiembre de 2022. Este paso es importante para sus plataformas VMware, ya que permitirá mejorar la calidad del servicio, el rendimiento y la seguridad de sus clusters. Y es que el hardware utilizado en las soluciones Dedicated Cloud, anterior a 2018, ya no nos permite garantizar el mejor nivel de servicio ni la integración de la solución en las arquitecturas modernas de VMware.", - "dedicatedCloud_datacenter_EOL_part_2": "Tras la recepción de nuestras anteriores comunicaciones, muchos de nuestros clientes ya han comenzado a planificar la migración de sus servicios. Así pues, le recomendamos que programe esta operación antes del final del ciclo de vida de la solución el próximo 30 de septiembre de 2022." -} \ No newline at end of file + "dedicatedCloud_datacenter_EOL_part_2": "Tras la recepción de nuestras anteriores comunicaciones, muchos de nuestros clientes ya han comenzado a planificar la migración de sus servicios. Así pues, le recomendamos que programe esta operación antes del final del ciclo de vida de la solución el próximo 30 de septiembre de 2022.", + "dedicatedCloud_datacenter_resize": "Redimensionar" +} diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_CA.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_CA.json index 8ac313d933f2..92fe74508c3b 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_CA.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_CA.json @@ -1,6 +1,7 @@ { "dedicatedCloud_datacenter_no_name": "Datacenter {{t0}}", "dedicatedCloud_datacenter_no_description": "Ajouter une description", + "dedicatedCloud_datacenter_resize": "Redimensionner", "dedicatedCloud_tab_dashboard": "Informations générales", "dedicatedCloud_tab_host": "Hosts", "dedicatedCloud_tab_datastore": "Datastores", diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_FR.json index 8ac313d933f2..92fe74508c3b 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_FR.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_fr_FR.json @@ -1,6 +1,7 @@ { "dedicatedCloud_datacenter_no_name": "Datacenter {{t0}}", "dedicatedCloud_datacenter_no_description": "Ajouter une description", + "dedicatedCloud_datacenter_resize": "Redimensionner", "dedicatedCloud_tab_dashboard": "Informations générales", "dedicatedCloud_tab_host": "Hosts", "dedicatedCloud_tab_datastore": "Datastores", diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_it_IT.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_it_IT.json index 1746bd33ed07..a049ae3e4310 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_it_IT.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_it_IT.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Disaster Recovery Plan (DRP)", "dedicatedCloud_datacenter_EOL_title": "Data di fine del ciclo di vita del Dedicated Cloud: 30 settembre 2022", "dedicatedCloud_datacenter_EOL_part_1": "Nell'ottobre 2021 abbiamo annunciato che la nostra soluzione Dedicated Cloud è ormai giunta alla fine del proprio ciclo di vita e sarà definitivamente disattivata il 30 settembre 2022. Questo è uno step importante per le piattaforme VMware e consentirà di migliorare la qualità del servizio, le performance e la sicurezza dei cluster. L’hardware utilizzato per le soluzioni \"Dedicated Cloud\", infatti, è anteriore al 2018 e non ci permette più di garantire il miglior livello di servizio e l'integrazione con le nuove architetture di VMware.", - "dedicatedCloud_datacenter_EOL_part_2": "In seguito alle nostre comunicazioni molti utenti hanno iniziato a pianificare la migrazione. Ti consigliamo di programmare l’operazione con anticipo ed evitare così la data limite del 30 settembre 2022." + "dedicatedCloud_datacenter_EOL_part_2": "In seguito alle nostre comunicazioni molti utenti hanno iniziato a pianificare la migrazione. Ti consigliamo di programmare l’operazione con anticipo ed evitare così la data limite del 30 settembre 2022.", + "dedicatedCloud_datacenter_resize": "Ridimensionare" } diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pl_PL.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pl_PL.json index 6355f40a0cec..f266815fcad5 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pl_PL.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pl_PL.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Plan Disaster Recovery (DRP)", "dedicatedCloud_datacenter_EOL_title": "Data wygaśnięcia Dedicated Cloud: 30 września 2022", "dedicatedCloud_datacenter_EOL_part_1": "W październiku 2021 roku poinformowaliśmy, że nasza oferta Dedicated Cloud dobiega końca i zostanie definitywnie wycofana z użytku 30 września 2022 roku. Krok ten jest ważny dla platform VMware, ponieważ pozwala zwiększyć jakość usługi, wydajność i bezpieczeństwo klastrów. Sprzęt (sprzed 2018 r.) wykorzystywany w ofercie „Dedicated Cloud” nie pozwala nam już zagwarantować najwyższego poziomu usług i zintegrować go z nowoczesnymi architekturami VMware.", - "dedicatedCloud_datacenter_EOL_part_2": "Po naszych wcześniejszych komunikatach wielu klientów rozpoczęło już planowanie i migrację. Zachęcamy do zrobienia tego samego, zanim upłynie ostateczny termin 30 września 2022 r." -} \ No newline at end of file + "dedicatedCloud_datacenter_EOL_part_2": "Po naszych wcześniejszych komunikatach wielu klientów rozpoczęło już planowanie i migrację. Zachęcamy do zrobienia tego samego, zanim upłynie ostateczny termin 30 września 2022 r.", + "dedicatedCloud_datacenter_resize": "Skaluj" +} diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pt_PT.json b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pt_PT.json index f5305e3cf091..4444a2a4a6e0 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pt_PT.json +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenter/translations/Messages_pt_PT.json @@ -8,5 +8,6 @@ "dedicatedCloud_tab_drp": "Plano de recuperação de desastres (DRP)", "dedicatedCloud_datacenter_EOL_title": "Data de fim de vida do Dedicated Cloud: 30 de setembro de 2022", "dedicatedCloud_datacenter_EOL_part_1": "Em outubro de 2021, informámos que as nossas ofertas Dedicated Cloud serão descontinuadas e definitivamente encerradas a 30 de setembro de 2022. Esta etapa é importante para as suas plataformas VMware de forma a melhorar a qualidade do serviço, o desempenho e a segurança dos seus clusters. O hardware das ofertas \"Dedicated Cloud\" utilizado, antes de 2018, já não nos permite assegurar o melhor nível de serviço e a integração com as novas arquiteturas modernas da VMware.", - "dedicatedCloud_datacenter_EOL_part_2": "Na sequência das nossas comunicações anteriores, muitos clientes iniciaram este planeamento e migração, pelo que lhe pedimos que faça o mesmo para evitar esta data-limite de 30 de setembro de 2022." + "dedicatedCloud_datacenter_EOL_part_2": "Na sequência das nossas comunicações anteriores, muitos clientes iniciaram este planeamento e migração, pelo que lhe pedimos que faça o mesmo para evitar esta data-limite de 30 de setembro de 2022.", + "dedicatedCloud_datacenter_resize": "Redimensionar" } diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenters/datacenters.controller.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenters/datacenters.controller.js index c3156d2dd0db..092f9b951843 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenters/datacenters.controller.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/datacenters/datacenters.controller.js @@ -36,7 +36,7 @@ export default class { return this.DedicatedCloud.getDatacenterInfoNsxt( this.dedicatedCloud.serviceName, id, - ).then(({ data }) => ({ + ).then((data) => ({ edgesCount: data.length, clusterSize: data[0]?.size ? EDGES_SIZES[data[0].size] : '', })); diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.constant.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.constant.js index be38d52c44b4..f2bcbf0af0bd 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.constant.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.constant.js @@ -3,6 +3,12 @@ export const DEDICATED_CLOUD_CONSTANTS = { pccNewGeneration: '2.0', }; +export const TASK_STATUS = { + DONE: 'done', + ERROR: 'error', + CANCELED: 'canceled', +}; + export const UNAVAILABLE_PCC_CODE = [400, 404]; export const VCD_PLAN_CODE = 'pcc-option-to-vcd-migration'; @@ -191,4 +197,5 @@ export default { MANAGED_VCD_MIGRATION_STATE, MANAGED_PCC_MIGRATION_STATUS, TRACKING_PREFIX, + TASK_STATUS, }; diff --git a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js index 035a50eaf41c..5fb7ede52192 100644 --- a/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js +++ b/packages/manager/apps/dedicated/client/app/components/dedicated-cloud/dedicatedCloud.service.js @@ -16,6 +16,7 @@ import { UNAVAILABLE_PCC_CODE, VCD_GUIDE_LINKS, VCD_SERVICE_PACK_PRICING_MODE, + TASK_STATUS, } from './dedicatedCloud.constant'; import { VM_ENCRYPTION_KMS } from './security/dedicatedCloud-security.constants'; @@ -340,6 +341,49 @@ class DedicatedCloudService { return this.icebergQuery( `/dedicatedCloud/${serviceName}/datacenter/${datacenterId}/nsxtEdge`, params, + ).then(({ data }) => data.filter((item) => item !== null)); + } + + getDatacenterPendingResizeNsxTask(serviceName, datacenterId, params = {}) { + return this.icebergQuery( + `/dedicatedCloud/${serviceName}/datacenter/${datacenterId}/task`, + params, + { + name: 'resizeNsxtEdgeCluster', + }, + ).then(({ data }) => + data.filter((item) => item.state !== TASK_STATUS.DONE), + ); + } + + datacenterResizeNsxTaskPoller(serviceName, taskId) { + return this.Poller.poll( + `/dedicatedCloud/${serviceName}/task/${taskId}`, + null, + { + method: 'get', + namespace: taskId, + interval: 3000, + successRule: (taskResult) => taskResult.state === TASK_STATUS.DONE, + errorRule: (taskResult) => taskResult.state === TASK_STATUS.ERROR, + }, + ); + } + + stopResizeNsxTaskPoller(taskId) { + return this.Poller.kill({ namespace: taskId }); + } + + getDatacenterNsxtEdgesScalingCapabilities(serviceName, datacenterId) { + return this.$http.get( + `/dedicatedCloud/${serviceName}/datacenter/${datacenterId}/nsxtEdgesResizingCapabilities`, + ); + } + + resizeNsxtEdgeCluster(serviceName, datacenterId, size) { + this.$http.post( + `/dedicatedCloud/${serviceName}/datacenter/${datacenterId}/resizeNsxtEdgeCluster`, + { size }, ); } @@ -551,7 +595,7 @@ class DedicatedCloudService { /* ------- ICEBERG -------*/ - icebergQuery(url, params) { + icebergQuery(url, params, urlParams = {}) { const { filters, pageSize, @@ -561,7 +605,7 @@ class DedicatedCloudService { defaultFilterColumn, } = params; - let request = this.iceberg(url) + let request = this.iceberg(url, urlParams) .query() .expand('CachedObjectList-Pages') .limit(pageSize) @@ -655,8 +699,8 @@ class DedicatedCloudService { namespace: 'dedicatedCloud.password.update.poll', task, user, - successSates: ['canceled', 'done'], - errorsSates: ['error'], + successSates: [TASK_STATUS.CANCELED, TASK_STATUS.DONE], + errorsSates: [TASK_STATUS.ERROR], }); }); } @@ -941,8 +985,8 @@ class DedicatedCloudService { namespace: 'dedicatedCloud.user.update.poll', task, user, - successSates: ['canceled', 'done'], - errorsSates: ['error'], + successSates: [TASK_STATUS.CANCELED, TASK_STATUS.DONE], + errorsSates: [TASK_STATUS.ERROR], }); }); } @@ -1378,19 +1422,19 @@ class DedicatedCloudService { ['apiv6/dedicatedCloud', opts.serviceName, 'task', taskId].join('/'), null, { - successRule: { state: 'done' }, + successRule: { state: TASK_STATUS.DONE }, namespace: 'dedicatedCloud.request', }, ).then( (task) => { this.$rootScope.$broadcast( - ['dedicatedCloud', opts.namespace, 'done'].join('.'), + ['dedicatedCloud', opts.namespace, TASK_STATUS.DONE].join('.'), task, ); }, (err) => { this.$rootScope.$broadcast( - ['dedicatedCloud', opts.namespace, 'error'].join('.'), + ['dedicatedCloud', opts.namespace, TASK_STATUS.ERROR].join('.'), err, ); }, diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.module.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.module.js index 363cfda9ad0e..be4210e175b7 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.module.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.module.js @@ -3,6 +3,7 @@ import angular from 'angular'; import datacenterDashboardComponent from '../../../components/dedicated-cloud/datacenter/dashboard'; import deleteDatacenter from './delete'; import deleteDrp from './deleteDrp'; +import manageNsxEdges from './manage-nsx-edges'; import routing from './dedicatedCloud.datacenter.dashboard.routes'; const moduleName = 'ovhManagerDedicatedCloudDatacenterDashboard'; @@ -12,6 +13,7 @@ angular datacenterDashboardComponent, deleteDatacenter, deleteDrp, + manageNsxEdges, ]) .config(routing); diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.routes.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.routes.js index cf5743360482..eb9956b0aa22 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.routes.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/dedicatedCloud.datacenter.dashboard.routes.js @@ -8,6 +8,72 @@ export default /* @ngInject */ ($stateProvider) => { }, resolve: { breadcrumb: () => null, + serviceName: /* @ngInject */ ($transition$) => + $transition$.params().productId, + datacenterId: /* @ngInject */ ($transition$) => + $transition$.params().datacenterId, + datastoreOrderLink: /* @ngInject */ ( + coreURLBuilder, + serviceName, + datacenterId, + ) => + coreURLBuilder.buildURL( + 'dedicated', + `#/dedicated_cloud/${serviceName}/datacenter/${datacenterId}/datastores/order`, + ), + hostOrderLink: /* @ngInject */ ( + coreURLBuilder, + serviceName, + datacenterId, + ) => + coreURLBuilder.buildURL( + 'dedicated', + `#/dedicated_cloud/${serviceName}/datacenter/${datacenterId}/hosts/order`, + ), + nsxEdgeCurrentLevel: /* @ngInject */ ( + DedicatedCloud, + serviceName, + datacenterId, + ) => { + return DedicatedCloud.getDatacenterInfoNsxt( + serviceName, + datacenterId, + ).then(([data]) => data?.size); + }, + nsxtEdgesScalingCapabilities: /* @ngInject */ ( + DedicatedCloud, + serviceName, + datacenterId, + ) => { + return DedicatedCloud.getDatacenterNsxtEdgesScalingCapabilities( + serviceName, + datacenterId, + ) + .then(({ data }) => data?.size) + .catch(() => []); + }, + goBackToDashboard: /* @ngInject */ ( + $state, + $timeout, + currentService, + setMessage, + ) => (message = false, type = 'success') => { + const reload = message && type === 'success'; + + const promise = $state.go( + 'app.dedicatedCloud.details.datacenter.details.dashboard', + { productId: currentService.serviceName }, + { + reload, + }, + ); + + if (message) { + promise.then(() => $timeout(() => setMessage(message, type))); + } + + return promise; + }, }, }, ); diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/constants.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/constants.js new file mode 100644 index 000000000000..25912cea5a86 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/constants.js @@ -0,0 +1,6 @@ +export const NSX_TRACKING_PREFIX = + 'dedicated::dedicatedCloud::details::datacenter::details::dashboard::nsx'; + +export default { + NSX_TRACKING_PREFIX, +}; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.module.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.module.js new file mode 100644 index 000000000000..d6c8c0f5b276 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.module.js @@ -0,0 +1,13 @@ +import angular from 'angular'; + +import datacenterManageNsxEdgesComponent from '../../../../components/dedicated-cloud/datacenter/dashboard/manage-nsx-edges'; +import routing from './dedicatedCloud-datacenter-manage-nsx.routing'; + +const moduleName = 'ovhManagerDedicatedCloudDatacenterManageNsxEdges'; + +angular + .module(moduleName, [datacenterManageNsxEdgesComponent]) + .config(routing) + .run(/* @ngTranslationsInject:json ./translations */); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.routing.js new file mode 100644 index 000000000000..dae77caff366 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/dedicatedCloud-datacenter-manage-nsx.routing.js @@ -0,0 +1,36 @@ +import { NSX_TRACKING_PREFIX } from './constants'; + +export default /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'app.dedicatedCloud.details.datacenter.details.dashboard.nsx', + { + resolve: { + goBack: /* @ngInject */ (trackClick, goBackToDashboard) => () => { + trackClick('::cancel'); + return goBackToDashboard(); + }, + breadcrumb: /* @ngInject */ ($translate) => + $translate.instant( + 'dedicated_cloud_datacenters_datacenter_manage_nsx_edge', + ), + trackPage: /* @ngInject */ (atInternet) => (hit) => { + return atInternet.trackPage(`${NSX_TRACKING_PREFIX}${hit}`); + }, + trackClick: /* @ngInject */ (atInternet) => (hit) => { + return atInternet.trackClick({ + name: `${NSX_TRACKING_PREFIX}${hit}`, + type: 'action', + }); + }, + }, + atInternet: { + rename: NSX_TRACKING_PREFIX, + }, + url: '/nsx', + views: { + 'pccDatacenterView@app.dedicatedCloud.details.datacenter.details': + 'ovhManagerDedicatedCloudDatacenterManageNsxEdges', + }, + }, + ); +}; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/index.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/index.js new file mode 100644 index 000000000000..0b0cd64b20df --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/index.js @@ -0,0 +1,27 @@ +import angular from 'angular'; +import '@uirouter/angularjs'; +import 'oclazyload'; + +const moduleName = + 'ovhManagerDedicatedCloudDatacenterManageNsxEdgesLazyloading'; + +angular.module(moduleName, ['ui.router', 'oc.lazyLoad']).config( + /* @ngInject */ ($stateProvider) => { + $stateProvider.state( + 'app.dedicatedCloud.details.datacenter.details.dashboard.nsx.**', + { + url: '/nsx', + lazyLoad: ($transition$) => { + const $ocLazyLoad = $transition$.injector().get('$ocLazyLoad'); + return import('./dedicatedCloud-datacenter-manage-nsx.module').then( + (mod) => { + $ocLazyLoad.inject(mod.default || mod); + }, + ); + }, + }, + ); + }, +); + +export default moduleName; diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_de_DE.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_de_DE.json new file mode 100644 index 000000000000..36100c3d198d --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_de_DE.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "NSX Edges anpassen" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_en_GB.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_en_GB.json new file mode 100644 index 000000000000..d63ca7cb63b8 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_en_GB.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "Resize NSX Edges" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_CA.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_CA.json new file mode 100644 index 000000000000..07aa05955ff6 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_CA.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "Redimensionner les NSX Edges" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_FR.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_FR.json new file mode 100644 index 000000000000..07aa05955ff6 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_fr_FR.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "Redimensionner les NSX Edges" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_it_IT.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_it_IT.json new file mode 100644 index 000000000000..7de8011c2c81 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_it_IT.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "Ridimensionare NSX Edges" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_pt_PT.json b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_pt_PT.json new file mode 100644 index 000000000000..ae81510e4547 --- /dev/null +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/datacenter/dashboard/manage-nsx-edges/translations/Messages_pt_PT.json @@ -0,0 +1,3 @@ +{ + "dedicated_cloud_datacenters_datacenter_manage_nsx_edge": "Redimensionar NSX Edges" +} diff --git a/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js b/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js index 30eb74f42a57..95ca18a823a3 100644 --- a/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js +++ b/packages/manager/apps/dedicated/client/app/dedicatedCloud/details/dedicatedCloud.routing.js @@ -278,6 +278,14 @@ export default /* @ngInject */ ($stateProvider) => { datacenterId, }, ), + goToResizeNsxEdge: /* @ngInject */ ($state) => (datacenterId) => { + $state.go( + 'app.dedicatedCloud.details.datacenter.details.dashboard.nsx', + { + datacenterId, + }, + ); + }, pccType: /* @ngInject */ (dedicatedCloud) => dedicatedCloud.productReference, setMessage: /* @ngInject */ (Alerter) => (