在 Portainer CE 2.9.1 中,可以通过发送 GET 请求到 /api/endpoints 的接口来获取 X-Registry-Auth 的值。这个请求会返回所有已配置的 Docker 环境的详细信息,其中包括 X-Registry-Auth 的值。

请求示例:

GET /api/endpoints

响应示例:

[
  {
    "Id": 1,
    "Name": "Docker",
    "URL": "unix:///var/run/docker.sock",
    "TLS": false,
    "PublicURL": "http://localhost:9000",
    "GroupID": 1,
    "Type": 1,
    "TLSConfig": {
      "InsecureSkipVerify": false,
      "TLSSkipVerify": false,
      "TLSSkipClientVerify": false,
      "TLSCACertFile": "",
      "TLSCertFile": "",
      "TLSKeyFile": ""
    },
    "AzureCredentials": {},
    "DockerHub": {},
    "RegistryManagement": {},
    "AllowBindMountsForRegularUsers": false,
    "AllowPrivilegedModeForRegularUsers": false,
    "AllowVolumeBrowserForRegularUsers": false,
    "AllowHostNamespaceForRegularUsers": false,
    "AllowDeviceMappingForRegularUsers": false,
    "AllowStackManagementForRegularUsers": false,
    "AllowContainerCapabilitiesForRegularUsers": false,
    "AllowSysctlForRegularUsers": false,
    "AllowServiceAccessForRegularUsers": false,
    "AllowTaskAccessForRegularUsers": false,
    "AllowStackManagementForAdminUsers": true,
    "AllowContainerCapabilitiesForAdminUsers": true,
    "AllowDeviceMappingForAdminUsers": true,
    "AllowHostNamespaceForAdminUsers": true,
    "AllowPrivilegedModeForAdminUsers": true,
    "AllowStackCreation": true,
    "AllowVolumeCreation": true,
    "AllowNetworkCreation": true,
    "AllowContainerCreation": true,
    "AllowServiceCreation": true,
    "AllowTaskCreation": true,
    "AllowImageDownload": true,
    "AllowImageUpload": true,
    "AllowTemplateCreation": true,
    "RestrictBindMounts": false,
    "RestrictPrivilegedMode": false,
    "RestrictVolumes": false,
    "RestrictNetworks": false,
    "RestrictCapabilities": false,
    "RestrictSysctls": false,
    "AgentType": 0,
    "UserAccessPolicies": [],
    "TeamAccessPolicies": [],
    "LDAPConfigurations": [],
    "OAuthConfigurations": [],
    "KubernetesConfigurations": [],
    "RBACEnabled": true,
    "SnapshotInterval": 3600,
    "SnapshotCreation": false,
    "SnapshotCleanup": false,
    "SnapshotRetention": 10,
    "SnapshotPath": "/data/snapshots",
    "ExternalTemplates": [],
    "UserLabels": {},
    "XRegistryAuth": 'eyJzZXJ2ZXIiOiJhZG1pbiIsImFjY2Vzc190b2tlbiI6ImFkbWluIn0='
  }
]

在这个示例中,XRegistryAuth 的值为 'eyJzZXJ2ZXIiOiJhZG1pbiIsImFjY2Vzc190b2tlbiI6ImFkbWluIn0='

Portainer CE 2.9.1 获取 X-Registry-Auth 值的 API 请求

原文地址: https://www.cveoy.top/t/topic/p79H 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录