示例

POST /api/reports
{
  "report": {
    "host": "rhel6n01.corp.com",
    "reported_at": "2010-11-19 02:39:04 UTC",
    "metrics": {},
    "status": {
      "applied": 0,
      "failed": 0,
      "failed_restarts": 0,
      "pending": 0,
      "restarted": 0,
      "skipped": 0
    },
    "logs": [
      {
        "log": {
          "sources": {
            "source": "Puppet"
          },
          "messages": {
            "message": "Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find node 'rhel6n01.corp.com'; cannot compile"
          },
          "level": "err"
        }
      },
      {
        "log": {
          "sources": {
            "source": "Puppet"
          },
          "messages": {
            "message": "Using cached catalog"
          },
          "level": "notice"
        }
      },
      {
        "log": {
          "sources": {
            "source": "Puppet"
          },
          "messages": {
            "message": "Could not retrieve catalog; skipping run"
          },
          "level": "err"
        }
      }
    ]
  }
}
403
{
  "error": {
    "message": "Access denied",
    "details": "Missing one of the required permissions: upload_config_reports"
  }
}

参数

参数名字 描述
location_id
选填

根据位置界定的范围

Validations:

  • Must be a Integer

organization_id
选填

根据机构界定的范围

Validations:

  • Must be a Integer

report
必填

Validations:

  • Must be a Hash

report[host]
必填

主机名或证书名称

Validations:

  • Must be a String

report[reported_at]
必填

报告的 UTC 时间

Validations:

  • Must be a String

report[status]
必填

状态类型哈希总计

Validations:

  • Must be a Hash

report[metrics]
必填

报告指标哈希,可只为 {}

Validations:

  • Must be a Hash

report[logs]
选填 , 允许空值

日志哈希的自选阵列

Validations:

  • Must be an array of any type