GET /api/bookmarks
すべてのブックマークを一覧表示

GET /api/v2/bookmarks?page=1&per_page=10&search=
200
{
  "total": 2,
  "subtotal": 2,
  "page": 1,
  "per_page": 10,
  "search": "",
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "name": "foo",
      "controller": "hosts",
      "query": "foo=boo",
      "public": true,
      "id": 980190962,
      "owner_id": null,
      "owner_type": null
    },
    {
      "name": "three",
      "controller": "hosts",
      "query": "three",
      "public": true,
      "id": 113629430,
      "owner_id": null,
      "owner_type": null
    }
  ]
}

パラメーター

パラメーター名 記述
location_id
任意

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
任意

Set the current organization context for the request

Validations:

  • Must be a Integer

search
任意

結果のフィルター

Validations:

  • Must be a String

order
任意

フィールドと順序のソート (例: ‘id DESC’)

Validations:

  • Must be a String

page
任意

1 から始まるページ番号

Validations:

  • Must be a number.

per_page
任意

戻されるページごとの結果数

Validations:

  • Must be a number.

検索フィールド

フィールド名 タイプ 設定可能な値
controller string
name string

GET /api/bookmarks/:id
ブックマークの表示

GET /api/bookmarks/980190962-foo
200
{
  "name": "foo",
  "controller": "hosts",
  "query": "foo=boo",
  "public": true,
  "id": 980190962,
  "owner_id": null,
  "owner_type": null
}

パラメーター

パラメーター名 記述
location_id
任意

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
任意

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必須

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/bookmarks
ブックマークの作成

POST /api/bookmarks
{
  "bookmark": {
    "public": false,
    "controller": "hosts",
    "name": "foo-bar",
    "query": "bar"
  }
}
201
{
  "name": "foo-bar",
  "controller": "hosts",
  "query": "bar",
  "public": false,
  "id": 980190963,
  "owner_id": 135138680,
  "owner_type": "User"
}

パラメーター

パラメーター名 記述
location_id
任意

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
任意

Set the current organization context for the request

Validations:

  • Must be a Integer

bookmark
必須

Validations:

  • Must be a Hash

bookmark[name]
必須

Validations:

  • Must be a String

bookmark[controller]
必須

Validations:

  • Must be a String

bookmark[query]
必須

Validations:

  • Must be a String

bookmark[public]
任意 , nil可

Validations:

  • Must be one of: true, false, 1, 0.


PUT /api/bookmarks/:id
ブックマークの更新

PUT /api/bookmarks/980190962-foo
{
  "bookmark": {
    "public": false,
    "controller": "hosts",
    "name": "facts.architecture",
    "query": " facts.architecture = x86_64"
  }
}
200
{
  "name": "facts.architecture",
  "controller": "hosts",
  "query": "facts.architecture = x86_64",
  "public": false,
  "id": 980190962,
  "owner_id": 135138680,
  "owner_type": "User"
}

パラメーター

パラメーター名 記述
location_id
任意

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
任意

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必須

Validations:

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

bookmark
必須

Validations:

  • Must be a Hash

bookmark[name]
任意

Validations:

  • Must be a String

bookmark[controller]
任意

Validations:

  • Must be a String

bookmark[query]
任意

Validations:

  • Must be a String

bookmark[public]
任意 , nil可

Validations:

  • Must be one of: true, false, 1, 0.


DELETE /api/bookmarks/:id
ブックマークの削除

DELETE /api/bookmarks/980190962-foo
{
  "bookmark": {}
}
200
{
  "id": 980190962,
  "name": "foo",
  "query": "foo=boo",
  "controller": "hosts",
  "public": true,
  "owner_id": null,
  "owner_type": null
}

パラメーター

パラメーター名 記述
location_id
任意

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
任意

Set the current organization context for the request

Validations:

  • Must be a Integer

id
必須

Validations:

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