Skip to content

Commit

Permalink
feat: Add SolarWinds Observability node credentials (#11805)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stamsy authored Dec 16, 2024
1 parent de75c7b commit e8a5db5
Show file tree
Hide file tree
Showing 3 changed files with 313 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import type {
IAuthenticateGeneric,
ICredentialTestRequest,
ICredentialType,
INodeProperties,
} from 'n8n-workflow';

export class SolarWindsObservabilityApi implements ICredentialType {
name = 'solarWindsObservabilityApi';

displayName = 'SolarWinds Observability';

documentationUrl = 'solarwindsobservability';

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

httpRequestNode = {
name: 'SolarWinds Observability',
docsUrl:
'https://documentation.solarwinds.com/en/success_center/observability/content/api/api-swagger.htm',
apiBaseUrlPlaceholder: 'https://api.xx-yy.cloud.solarwinds.com/',
};

properties: INodeProperties[] = [
{
displayName: 'URL',
name: 'url',
required: true,
type: 'string',
default: '',
},
{
displayName: 'API Token',
name: 'apiToken',
required: true,
type: 'string',
typeOptions: { password: true },
default: '',
},
];

authenticate: IAuthenticateGeneric = {
type: 'generic',
properties: {
headers: {
Authorization: '=Bearer {{$credentials.apiToken}}',
'Content-Type': 'application/json-rpc',
},
},
};

test: ICredentialTestRequest = {
request: {
baseURL: '={{$credentials.url}}'.replace(/\/$/, ''),
url: '/v1/logs',
method: 'GET',
},
rules: [
{
type: 'responseSuccessBody',
properties: {
key: 'error',
value: 'invalid_auth',
message: 'Invalid access token',
},
},
],
};
}
240 changes: 240 additions & 0 deletions packages/nodes-base/credentials/icons/SolarWindsObservability.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/SolarWindsObservabilityApi.credentials.js",
"dist/credentials/SplunkApi.credentials.js",
"dist/credentials/SpontitApi.credentials.js",
"dist/credentials/SpotifyOAuth2Api.credentials.js",
Expand Down

0 comments on commit e8a5db5

Please # to comment.