带有验证的 VSTS 服务终结点 link

VSTS Service Endpoint with validation link

你好,我创建了一个服务端点来读取这个VSTS Service EndPoint Tutorial,我创建成功了。 当我看到 jenkins 端点时,它有一个验证 link 来验证端点 我google样本太多但没有相关信息。任何人都可以帮助实现这一目标。

需要在vss-extension.json文件中添加TestConnection名称的数据源,例如:

{
      "id": "service-endpoint",
      "description": "Service Endpoint type for Fabrikam connections",
      "type": "ms.vss-endpoint.service-endpoint-type",
      "targets": [ "ms.vss-endpoint.endpoint-types" ],
      "properties": {
        "name": "fabrikam",
        "displayName": "Fabrikam server connection",
        "url": {
          "displayName": "Server Url",
          "helpText": "Url for the Fabrikam server to connect to."
        },
        "dataSources": [
          { 
              "name": "TestConnection",
              "endpointUrl": "{{endpoint.url}}api/projects/index",
              "resultSelector": "jsonpath:$[*].nm" 
          },
          {
            "name": "Fabrikam Projects",
            "endpointUrl": "{{endpoint.url}}api/projects/index",
            "resultSelector": "jsonpath:$[*].nm"
          }

        ],
        "authenticationSchemes": [
          {
            "type": "ms.vss-endpoint.endpoint-auth-scheme-token"
          },
          {
            "type": "ms.vss-endpoint.endpoint-auth-scheme-basic",
            "inputDescriptors": [
              {
                "id": "username",
                "name": "Username",
                "description": "Username",
                "inputMode": "textbox",
                "validation": {
                  "isRequired": false,
                  "dataType": "string"
                }
              },
              {
                "id": "password",
                "name": "Password",
                "description": "Password",
                "inputMode": "passwordbox",
                "isConfidential": true,
                "validation": {
                  "isRequired": false,
                  "dataType": "string"
                }
              }
            ]
          }

        ],
        "helpMarkDown": "<a href=\"url-to-documentation\" target=\"_blank\"><b>Learn More</b></a>"
      }
    }