https.HttpsOptions interface

可在 onRequest HTTPS 函式上設定的選項。

簽名:

export interface HttpsOptions extends Omit<GlobalOptions, "region"> 

擴充:Omit<GlobalOptions、"region">

屬性

屬性 類型 說明
並行 數字 |運算式<數字>|重設值 函式可同時提供的要求數量。
科羅 字串 |布林值 |規則運算式 |陣列<字串 |規則運算式> 如果為 true,則允許對這個函式的要求使用 CORS。如果是 stringRegExp,系統會允許與提供值相符的網域發出要求。如果這是 Array,則允許與至少一個陣列項目相符的網域提出要求。https.CallableFunction 預設為 true,否則預設為 false。
CPU 數字 |「gcf_gen1」 要分配給函式的 CPU 數量 (以比例為單位)。
ingressSettings options.IngressSetting |重設值 輸入設定,控管可以從何處呼叫這個函式。
叫用者 「公開」|「私人」|字串 |字串 [] 叫用來設定 HTTPS 函式的存取權控管。
標籤 錄音<字串, 字串> 要在函式上設定的使用者標籤。
maxInstances 數字 |運算式<數字>|重設值 同時執行的執行個體數量上限。
記憶體 options.MemoryOption |運算式<數字>|重設值 要分配給函式的記憶體量。
minInstances 數字 |運算式<數字>|重設值 在指定時間運作的實際執行個體數量下限。
省略 布林值 |運算式<boolean> 若為 true,請勿部署或模擬此函式。
region [區域] 支援的區域 |字串 |Array<SupportedRegion |字串>|運算式<字串>|重設值 HTTP 函式可以覆寫全域選項,並可指定多個部署區域。
秘密 (字串 | SecretParam)[]
serviceAccount 字串 |運算式<字串>|重設值 要做為函式執行的特定服務帳戶。
逾時秒數 數字 |運算式<數字>|重設值 函式的逾時時間 (以秒為單位),可能的值為 0 到 540。HTTPS 函式可以指定較長的逾時時間。
vpcConnector 字串 |運算式<字串>|重設值 將 Cloud 函式連線至指定的虛擬私有雲連接器。
vpcConnectoregressSettings options.VpcegressSetting |重設值 虛擬私有雲連接器的輸出設定。

https.HttpsOptions.concurrency (https.HttpsOptions.concurrency)

函式可同時提供的要求數量。

只能套用至在 Cloud Functions v2 上執行的函式。值為空值會還原預設並行 (CPU >= 1 時為 80,否則為 1)。如果 cpu 小於 1,並行就無法設為 1 以外的任何值。並行的最大值為 1,000。

簽名:

concurrency?: number | Expression<number> | ResetValue;

https.HttpsOptions.cors (https.HttpsOptions.cors)

如果為 true,則允許對這個函式的要求使用 CORS。如果是 stringRegExp,系統會允許與所提供值相符的網域發出要求。如果這是 Array,則允許與至少一個陣列項目相符的網域提出要求。https.CallableFunction 預設為 true,否則預設為 false。

簽名:

cors?: string | boolean | RegExp | Array<string | RegExp>;

https.HttpsOptions.cpu

要分配給函式的 CPU 數量 (以比例為單位)。

如果函式中的 RAM = 2 GB,預設值為 1;記憶體容量越大,則會增加。這與使用 gcloud 公用程式時的預設值不同,與 Google Cloud Functions 第 1 代指派的固定金額不同。如要還原為 gcloud 或 Cloud Functions 第 1 代使用的 CPU 數量,請將這個值設為「gcf_gen1」

簽名:

cpu?: number | "gcf_gen1";

https.HttpsOptions.ingressSettings

輸入設定,控管可以從何處呼叫這個函式。

簽名:

ingressSettings?: options.IngressSetting | ResetValue;

https.HttpsOptions.invoker

叫用來設定 HTTPS 函式的存取權控管。

簽名:

invoker?: "public" | "private" | string | string[];

https.HttpsOptions.labels

要在函式上設定的使用者標籤。

簽名:

labels?: Record<string, string>;

https.HttpsOptions.maxInstances

同時執行的執行個體數量上限。

簽名:

maxInstances?: number | Expression<number> | ResetValue;

https.HttpsOptions.memory

要分配給函式的記憶體量。

簽名:

memory?: options.MemoryOption | Expression<number> | ResetValue;

https.HttpsOptions.minInstances

在指定時間運作的實際執行個體數量下限。

系統會在執行個體閒置時收取記憶體分配費用和 10% 的 CPU 分配費用。

簽名:

minInstances?: number | Expression<number> | ResetValue;

https.HttpsOptions.omit

若為 true,請勿部署或模擬此函式。

簽名:

omit?: boolean | Expression<boolean>;

https.HttpsOptions.region

HTTP 函式可以覆寫全域選項,並可指定多個部署區域。

簽名:

region?: SupportedRegion | string | Array<SupportedRegion | string> | Expression<string> | ResetValue;

https.HttpsOptions.secrets

簽名:

secrets?: (string | SecretParam)[];

https.HttpsOptions.serviceAccount

要做為函式執行的特定服務帳戶。

簽名:

serviceAccount?: string | Expression<string> | ResetValue;

https.HttpsOptions.timeoutSeconds

函式的逾時時間 (以秒為單位),可能的值為 0 到 540。HTTPS 函式可以指定較長的逾時時間。

第 2 代函式的逾時時間下限為 1 秒。函式的逾時時間上限取決於函式類型:事件處理函式的逾時時間上限為 540 秒 (9 分鐘),HTTPS 和可呼叫函式的逾時時間上限為 36,00 秒 (1 小時)。工作佇列函式的逾時時間上限為 1,800 秒 (30 分鐘)

簽名:

timeoutSeconds?: number | Expression<number> | ResetValue;

https.HttpsOptions.vpcConnector (https.HttpsOptions.vpcConnector)

將 Cloud 函式連線至指定的虛擬私有雲連接器。

簽名:

vpcConnector?: string | Expression<string> | ResetValue;

https.HttpsOptions.vpcConnectoregressSettings

虛擬私有雲連接器的輸出設定。

簽名:

vpcConnectorEgressSettings?: options.VpcEgressSetting | ResetValue;