-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(pci-block-storage): use volume catalog
Signed-off-by: Simon Chaumet <[email protected]>
- Loading branch information
1 parent
5be5c2a
commit 209036b
Showing
34 changed files
with
608 additions
and
613 deletions.
There are no files selected for viewing
Binary file removed
BIN
-992 KB
packages/manager/apps/pci-block-storage/ovh-ux-manager-pci-common-v0.15.0-3az.tgz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 0 additions & 36 deletions
36
packages/manager/apps/pci-block-storage/src/api/data/availableVolumes.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 11 additions & 18 deletions
29
packages/manager/apps/pci-block-storage/src/api/data/regions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,16 @@ | ||
import { fetchIcebergV6 } from '@ovh-ux/manager-core-api'; | ||
import { TVolumeCatalogElementFilter } from '@/api/data/catalog'; | ||
|
||
export type TRegion = { | ||
name: string; | ||
type: string; | ||
status: string; | ||
continentCode: string; | ||
services: { | ||
name: string; | ||
status: string; | ||
endpoint: string; | ||
}[]; | ||
datacenterLocation: string; | ||
type: 'region-3-az' | 'region' | 'localzone'; | ||
availabilityZones: string[]; | ||
isInMaintenance: boolean; | ||
isActivated: boolean; | ||
country: string; | ||
filters: TVolumeCatalogElementFilter; | ||
datacenter: string; | ||
}; | ||
|
||
export const getProjectRegions = async ( | ||
projectId: string, | ||
): Promise<TRegion[]> => { | ||
const { data } = await fetchIcebergV6<TRegion>({ | ||
route: `/cloud/project/${projectId}/region`, | ||
}); | ||
return data; | ||
}; | ||
export function isRegionWith3AZ(region: Pick<TRegion, 'type'>) { | ||
return region.type === 'region-3-az'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/manager/apps/pci-block-storage/src/api/hooks/useHas3AZRegion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { useVolumeCatalog } from '@/api/hooks/useCatalog'; | ||
|
||
export const useHas3AZRegion = (projectId: string) => { | ||
const { data: volumeCatalog, isPending } = useVolumeCatalog(projectId); | ||
|
||
return { | ||
has3AZ: | ||
volumeCatalog?.models.some((m) => | ||
m.filters.deployment.includes('region-3-az'), | ||
) || false, | ||
isPending, | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19
packages/manager/apps/pci-block-storage/src/api/hooks/useProjectsAvailableVolumes.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.