diff --git a/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts b/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts index 0fea551ee4..c200acd8f7 100644 --- a/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts +++ b/packages/nodes-base/credentials/VenafiTlsProtectCloudApi.credentials.ts @@ -13,6 +13,22 @@ export class VenafiTlsProtectCloudApi implements ICredentialType { documentationUrl = 'venafitlsprotectcloud'; properties: INodeProperties[] = [ + { + displayName: 'Region', + name: 'region', + type: 'options', + options: [ + { + name: 'US', + value: 'cloud', + }, + { + name: 'EU', + value: 'eu', + }, + ], + default: 'cloud', + }, { displayName: 'API Key', name: 'apiKey', @@ -33,7 +49,7 @@ export class VenafiTlsProtectCloudApi implements ICredentialType { test: ICredentialTestRequest = { request: { - baseURL: 'https://api.venafi.cloud', + baseURL: '=https://api.venafi.{{$credentials.region ?? "cloud"}}', url: '/v1/preferences', }, }; diff --git a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts index f4a08a7279..58e2066a32 100644 --- a/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Venafi/ProtectCloud/GenericFunctions.ts @@ -23,6 +23,9 @@ export async function venafiApiRequest( option: IDataObject = {}, ): Promise { const operation = this.getNodeParameter('operation', 0); + const credentials = await this.getCredentials('venafiTlsProtectCloudApi'); + + const region = credentials.region ?? 'cloud'; const options: OptionsWithUri = { headers: { @@ -32,7 +35,7 @@ export async function venafiApiRequest( method, body, qs, - uri: `https://api.venafi.cloud${resource}`, + uri: `https://api.venafi.${region}${resource}`, json: true, };