GET /api/trends
List of trends counters

Examples

GET /api/trends
200
{
  "total": 2,
  "subtotal": 2,
  "page": 1,
  "per_page": 20,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "created_at": "2020-05-20 13:45:31 UTC",
      "updated_at": "2020-05-20 13:45:31 UTC",
      "id": 12,
      "trendable_type": "Environment",
      "trendable_id": 27,
      "fact_name": "fact",
      "type": "ForemanTrend",
      "name": "trend8",
      "label": "Environment"
    },
    {
      "created_at": "2020-05-20 13:45:31 UTC",
      "updated_at": "2020-05-20 13:45:31 UTC",
      "id": 16,
      "trendable_type": "FactName",
      "trendable_id": 116,
      "fact_name": "fact295",
      "type": "FactTrend",
      "name": "trend9",
      "label": "trend9"
    }
  ]
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer


GET /api/trends/:id
Show a trend

Examples

GET /api/trends/25
200
{
  "created_at": "2020-05-20 13:45:32 UTC",
  "updated_at": "2020-05-20 13:45:32 UTC",
  "id": 25,
  "trendable_type": "Environment",
  "trendable_id": 31,
  "fact_name": "fact",
  "type": "ForemanTrend",
  "name": "trend12",
  "label": "Environment"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/trends
Create a trend counter

Examples

POST /api/trends
{
  "trend": {
    "trendable_type": "NotExists"
  }
}
500
{
  "error": {
    "message": "uninitialized constant NotExists"
  }
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

trendable_type
required

Validations:

  • Must be one of: Environment, Operatingsystem, Model, FactName, Hostgroup, ComputeResource.

fact_name
optional

Validations:

  • Must be a String

name
optional

Validations:

  • Must be a String


DELETE /api/trends/:id
Delete a trend counter

Examples

DELETE /api/trends/7
{
  "trend": {}
}
200
{
  "id": 7,
  "trendable_type": "Environment",
  "trendable_id": 25,
  "name": "trend6",
  "fact_value": null,
  "fact_name": "fact",
  "created_at": "2020-05-20T13:45:31.357Z",
  "updated_at": "2020-05-20T13:45:31.357Z"
}

Params

Param name Description
location_id
optional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
optional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
required

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.