Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
/plugins/Steam/ @kmichalski0
/plugins/SumoLogic/ @richpeters
/plugins/Supabase/ @adamkinniburgh
/plugins/TeamCity/ @clarkd
/plugins/TeamDynamix/ @shawn149
/plugins/TransportForLondon/ @clarkd
/plugins/UniFi/ @adamkinniburgh
Expand Down
25 changes: 25 additions & 0 deletions plugins/TeamCity/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"steps": [
{
"displayName": "Authenticate",
"dataStream": {
"name": "server"
},
"required": true,
"error": "Could not connect to TeamCity. Check the server URL is reachable from SquaredUp and the access token is valid and has not expired.",
"success": "Connected to TeamCity successfully."
},
{
"displayName": "Check data access",
"dataStream": {
"name": "buildTypes",
"config": {
"errorOnEmptyResults": true
}
},
"required": false,
"error": "Connected, but no build configurations were returned. Check the user the access token belongs to can view at least one project.",
"success": "Build configurations are accessible."
}
]
}
23 changes: 23 additions & 0 deletions plugins/TeamCity/v1/custom_types.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
{
"name": "Project",
"sourceType": "Project",
"icon": "folder-tree",
"singular": "Project",
"plural": "Projects"
},
{
"name": "Build Configuration",
"sourceType": "Build Configuration",
"icon": "gears",
"singular": "Build Configuration",
"plural": "Build Configurations"
},
{
"name": "Agent",
"sourceType": "Agent",
"icon": "server",
"singular": "Agent",
"plural": "Agents"
}
]
77 changes: 77 additions & 0 deletions plugins/TeamCity/v1/dataStreams/agentList.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{
"name": "agentList",
"displayName": "Agent List",
"description": "Authorized TeamCity build agents, with their pool, IP address and operating system",
"tags": [
"Inventory"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "agents",
"getArgs": [
{
"key": "locator",
"value": "authorized:true,connected:any,enabled:any,count:1000"
},
{
"key": "fields",
"value": "nextHref,agent(id,name,ip,pool(id,name),environment(osType,osName))"
}
],
"paging": {
"mode": "nextUrl",
"in": {
"realm": "payload",
"path": "nextHref"
}
},
"postRequestScript": "pagedList.js",
"expandInnerObjects": true
},
"matches": "none",
"visibility": {
"type": "hidden"
},
"metadata": [
{
"name": "id",
"displayName": "ID",
"shape": "string",
"role": "id"
},
{
"name": "name",
"displayName": "Agent",
"shape": "string",
"role": "label"
},
{
"name": "pool.name",
"displayName": "Pool",
"shape": "string"
},
{
"name": "pool.id",
"displayName": "Pool ID",
"shape": "string",
"visible": false
},
{
"name": "ip",
"displayName": "IP Address",
"shape": "string"
},
{
"name": "environment.osType",
"displayName": "OS Type",
"shape": "string"
},
{
"name": "environment.osName",
"displayName": "OS",
"shape": "string"
}
],
"timeframes": false
}
198 changes: 198 additions & 0 deletions plugins/TeamCity/v1/dataStreams/agents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"name": "agents",
"displayName": "Agents",
"description": "Live status of TeamCity build agents, with the build each is running now, its pool and operating system",
"tags": [
"Agents"
],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "agents",
"getArgs": [
{
"key": "locator",
"value": "{{ (() => { const ids = (typeof agent !== 'undefined' && Array.isArray(agent) ? agent : []).map(a => Array.isArray(a.rawId) ? a.rawId[0] : a.rawId).filter(Boolean); const idPart = ids.length === 1 ? `id:${ids[0]}` : ids.length > 1 ? `item:(${ids.map(i => `id:${i}`).join('),item:(')})` : ''; return [idPart, `authorized:${String(typeof includeUnauthorized === 'undefined' ? '' : includeUnauthorized) === 'true' ? 'any' : 'true'}`, 'connected:any', 'enabled:any', 'count:500'].filter(Boolean).join(','); })() }}"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
},
{
"key": "fields",
"value": "nextHref,agent(id,name,connected,enabled,authorized,uptodate,ip,lastActivityTime,pool(id,name),environment(osType,osName),build(id,number,buildTypeId,buildType(id,name,projectName)),enabledInfo(comment(text)),authorizedInfo(comment(text)),webUrl)"
}
],
"paging": {
"mode": "nextUrl",
"in": {
"realm": "payload",
"path": "nextHref"
}
},
"postRequestScript": "pagedList.js",
"expandInnerObjects": true
},
"matches": "none",
"ui": [
{
"type": "objects",
"name": "agent",
"label": "Agent(s)",
"matches": {
"sourceType": {
"type": "oneOf",
"values": [
"Agent"
]
}
}
},
{
"type": "toggle",
"name": "includeUnauthorized",
"label": "Include unauthorized agents",
"defaultValue": false
}
],
"metadata": [
{
"name": "id",
"displayName": "ID",
"shape": "string",
"role": "id"
},
{
"name": "name",
"displayName": "Agent",
"shape": "string",
"role": "label"
},
{
"sourceId": "id",
"sourceType": "Agent",
"name": "name"
},
{
"name": "status",
"displayName": "Status",
"shape": [
"state",
{
"map": {
"error": [
"Disconnected"
],
"warning": [
"Disabled",
"Outdated",
"Unauthorized"
],
"success": [
"Healthy"
]
}
}
],
"computed": true,
"valueExpression": "{{ $['connected'] === false ? 'Disconnected' : $['authorized'] === false ? 'Unauthorized' : $['enabled'] === false ? 'Disabled' : $['uptodate'] === false ? 'Outdated' : 'Healthy' }}"
},
{
"name": "connected",
"displayName": "Connected",
"shape": "boolean"
},
{
"name": "enabled",
"displayName": "Enabled",
"shape": "boolean"
},
{
"name": "authorized",
"displayName": "Authorized",
"shape": "boolean"
},
{
"name": "uptodate",
"displayName": "Up to Date",
"shape": "boolean"
},
{
"name": "build.number",
"displayName": "Current Build",
"shape": "string"
},
{
"name": "build.buildType.name",
"displayName": "Current Build Configuration",
"shape": "string"
},
{
"name": "build.buildTypeId",
"displayName": "Current Build Configuration ID",
"shape": "string",
"visible": false
},
{
"sourceId": "build.buildTypeId",
"sourceType": "Build Configuration",
"name": "build.buildType.name"
},
{
"name": "build.id",
"displayName": "Current Build ID",
"shape": "string",
"visible": false
},
{
"name": "pool.name",
"displayName": "Pool",
"shape": "string"
},
{
"name": "pool.id",
"displayName": "Pool ID",
"shape": "string",
"visible": false
},
{
"name": "environment.osName",
"displayName": "OS",
"shape": "string"
},
{
"name": "environment.osType",
"displayName": "OS Type",
"shape": "string",
"visible": false
},
{
"name": "ip",
"displayName": "IP Address",
"shape": "string"
},
{
"name": "lastActivityTime",
"displayName": "Last Activity",
"shape": "date"
},
{
"name": "enabledInfo.comment.text",
"displayName": "Disabled Reason",
"shape": "string"
},
{
"name": "authorizedInfo.comment.text",
"displayName": "Unauthorized Reason",
"shape": "string",
"visible": false
},
{
"name": "webUrl",
"displayName": "URL",
"shape": [
"url",
{
"label": "Open in TeamCity"
}
]
}
],
"timeframes": false
}
Loading
Loading