add capacityMode (#1826)
* add capacityMode * add check for capacityMode for serverless
This commit is contained in:
parent
ff4bc78d6c
commit
4da3363cf7
|
@ -90,6 +90,11 @@ export class CapabilityNames {
|
|||
public static readonly EnableServerless: string = "EnableServerless";
|
||||
}
|
||||
|
||||
export enum CapacityMode {
|
||||
Provisioned = "Provisioned",
|
||||
Serverless = "Serverless",
|
||||
}
|
||||
|
||||
// flight names returned from the portal are always lowercase
|
||||
export class Flights {
|
||||
public static readonly SettingsV2 = "settingsv2";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { ConnectionStatusType, ContainerStatusType } from "../Common/Constants";
|
||||
import { CapacityMode, ConnectionStatusType, ContainerStatusType } from "../Common/Constants";
|
||||
|
||||
export interface ArmEntity {
|
||||
id: string;
|
||||
|
@ -35,6 +35,7 @@ export interface DatabaseAccountExtendedProperties {
|
|||
ipRules?: IpRule[];
|
||||
privateEndpointConnections?: unknown[];
|
||||
capacity?: { totalThroughputLimit: number };
|
||||
capacityMode?: CapacityMode;
|
||||
locations?: DatabaseAccountResponseLocation[];
|
||||
postgresqlEndpoint?: string;
|
||||
publicNetworkAccess?: string;
|
||||
|
|
|
@ -9,4 +9,10 @@ export const isCapabilityEnabled = (capabilityName: string): boolean => {
|
|||
return false;
|
||||
};
|
||||
|
||||
export const isServerlessAccount = (): boolean => isCapabilityEnabled(Constants.CapabilityNames.EnableServerless);
|
||||
export const isServerlessAccount = (): boolean => {
|
||||
const { databaseAccount } = userContext;
|
||||
return (
|
||||
databaseAccount?.properties?.capacityMode === Constants.CapacityMode.Serverless ||
|
||||
isCapabilityEnabled(Constants.CapabilityNames.EnableServerless)
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue