Skip to content

Commit

Permalink
feat: Add solarwinds ipam credentials (#12005)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stamsy authored Dec 19, 2024
1 parent a99d726 commit 882484e
Show file tree
Hide file tree
Showing 3 changed files with 157 additions and 0 deletions.
85 changes: 85 additions & 0 deletions packages/nodes-base/credentials/SolarWindsIpamApi.credentials.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';

export class SolarWindsIpamApi implements ICredentialType {
name = 'solarWindsIpamApi';

displayName = 'SolarWinds IPAM';

documentationUrl = 'solarwindsipam';

icon = {
light: 'file:icons/SolarWindsIpam.svg',
dark: 'file:icons/SolarWindsIpam.svg',
} as const;

httpRequestNode = {
name: 'SolarWinds IPAM',
docsUrl: 'https://www.solarwinds.com/ip-address-manager',
apiBaseUrlPlaceholder: 'https://your-ipam-server',
};

properties: INodeProperties[] = [
{
displayName: 'Base URL',
name: 'url',
required: true,
type: 'string',
default: '',
placeholder: 'https://your-ipam-server',
description: 'The base URL of your SolarWinds IPAM server.',
},
{
displayName: 'Username',
name: 'username',
required: true,
type: 'string',
default: '',
description: 'The username for SolarWinds IPAM API.',
},
{
displayName: 'Password',
name: 'password',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
description: 'The password for SolarWinds IPAM API.',
},
];

authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
auth: {
username: '={{$credentials.username}}',
password: '={{$credentials.password}}',
},
},
};

test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.url}}'.replace(/\/$/, ''),
url: '/SolarWinds/InformationService/v3/Json/Query',
method: 'GET',
qs: {
query: 'SELECT TOP 1 AccountID FROM IPAM.AccountRoles',
},
skipSslCertificateValidation: true,
},
rules: [
{
type: 'responseCode',
properties: {
value: 403,
message: 'Connection failed: Invalid credentials or unreachable server',
},
},
],
};
}
71 changes: 71 additions & 0 deletions packages/nodes-base/credentials/icons/SolarWindsIpam.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/nodes-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
"dist/credentials/Sms77Api.credentials.js",
"dist/credentials/Smtp.credentials.js",
"dist/credentials/Snowflake.credentials.js",
"dist/credentials/SolarWindsIpamApi.credentials.js",
"dist/credentials/SolarWindsObservabilityApi.credentials.js",
"dist/credentials/SplunkApi.credentials.js",
"dist/credentials/SpontitApi.credentials.js",
Expand Down

0 comments on commit 882484e

Please sign in to comment.