2022-10-16 06:26:31 -07:00
|
|
|
import {
|
|
|
|
IAuthenticateGeneric,
|
|
|
|
ICredentialTestRequest,
|
|
|
|
ICredentialType,
|
|
|
|
INodeProperties,
|
|
|
|
} from 'n8n-workflow';
|
2020-03-12 11:57:57 -07:00
|
|
|
|
2020-03-15 11:20:41 -07:00
|
|
|
export class RundeckApi implements ICredentialType {
|
|
|
|
name = 'rundeckApi';
|
|
|
|
displayName = 'Rundeck API';
|
2020-08-17 05:42:09 -07:00
|
|
|
documentationUrl = 'rundeck';
|
2021-06-12 09:39:55 -07:00
|
|
|
properties: INodeProperties[] = [
|
2020-03-12 11:57:57 -07:00
|
|
|
{
|
|
|
|
displayName: 'Url',
|
|
|
|
name: 'url',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-03-12 11:57:57 -07:00
|
|
|
default: '',
|
2020-03-15 11:20:41 -07:00
|
|
|
placeholder: 'http://127.0.0.1:4440',
|
2020-03-12 11:57:57 -07:00
|
|
|
},
|
|
|
|
{
|
|
|
|
displayName: 'Token',
|
|
|
|
name: 'token',
|
2021-06-12 09:39:55 -07:00
|
|
|
type: 'string',
|
2020-03-12 11:57:57 -07:00
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
];
|
2022-11-22 03:44:35 -08:00
|
|
|
|
2022-10-16 06:26:31 -07:00
|
|
|
authenticate: IAuthenticateGeneric = {
|
|
|
|
type: 'generic',
|
|
|
|
properties: {
|
|
|
|
headers: {
|
|
|
|
'user-agent': 'n8n',
|
|
|
|
'X-Rundeck-Auth-Token': '={{$credentials?.token}}',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
test: ICredentialTestRequest = {
|
|
|
|
request: {
|
|
|
|
baseURL: '={{$credentials.url}}',
|
|
|
|
url: '/api/14/system/info',
|
|
|
|
method: 'GET',
|
|
|
|
},
|
2022-11-22 03:44:35 -08:00
|
|
|
};
|
2020-03-12 11:57:57 -07:00
|
|
|
}
|