GET /api/hosts/:host_id/subscriptions
List a host's subscriptions

Examples

GET /api/hosts/980191213/subscriptions
200
{
  "total": 0,
  "subtotal": 0,
  "selectable": 0,
  "page": 1,
  "per_page": 0,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

Params

Param name Description
host_id
required

Id of the host

Validations:

  • Integer


PUT /api/hosts/:host_id/subscriptions/auto_attach
Trigger an auto-attach of subscriptions

Examples

PUT /api/hosts/980191210/subscriptions/auto_attach
{
  "host_subscription": {}
}
204

Params

Param name Description
host_id
required

Id of the host

Validations:

  • Integer


DELETE /api/hosts/:host_id/subscriptions
Unregister the host as a subscription consumer

Examples

DELETE /api/hosts/980191151/subscriptions
{
  "host_subscription": {}
}
200
{}

Params

Param name Description
host_id
required

Id of the host

Validations:

  • Integer


POST /api/hosts/subscriptions
Register a host with subscription and information

Examples

POST /api/hosts/subscriptions
{
  "lifecycle_environment_id": 562075838,
  "content_view_id": 30237652,
  "facts": {
    "network.hostname": "host500"
  },
  "installed_products": [
    {
      "product_id": "1",
      "product_name": "name"
    }
  ],
  "purpose_role": "MyRole",
  "purpose_usage": "MyUsage",
  "purpose_addons": "Addon1,Addon2",
  "host_subscription": {
    "lifecycle_environment_id": 562075838,
    "content_view_id": 30237652,
    "facts": {
      "network.hostname": "host500"
    },
    "installed_products": [
      {
        "product_id": "1",
        "product_name": "name"
      }
    ],
    "purpose_role": "MyRole",
    "purpose_usage": "MyUsage",
    "purpose_addons": "Addon1,Addon2"
  }
}
200
{
  "id": 980191207,
  "name": "host500",
  "operatingsystem_family": null,
  "operatingsystem_major": "55"
}

Params

Param name Description
name
required

Name of the host

Validations:

  • String

uuid
optional

UUID to use for registered host, random uuid is generated if not provided

Validations:

  • String

facts
optional

Key-value hash of subscription-manager facts, nesting uses a period delimiter (.)

Validations:

  • Hash

hypervisor_guest_uuids
optional

UUIDs of the virtual guests from the host's hypervisor

Validations:

  • Must be an array of any type

installed_products
optional

List of products installed on the host

Validations:

  • Must be an Array of nested elements

installed_products[product_id]
optional

Product id as listed from a host's installed products, this is not the same product id as the products api returns

Validations:

  • String

installed_products[product_name]
optional

Product name as listed from a host's installed products

Validations:

  • String

installed_products[arch]
optional

Product architecture

Validations:

  • String

installed_products[version]
optional

Product version

Validations:

  • String

release_version
optional

Release version of the content host

Validations:

  • String

service_level
optional

A service level for auto-healing process, e.g. SELF-SUPPORT

Validations:

  • String

lifecycle_environment_id
required

Lifecycle Environment ID

Validations:

  • Integer

content_view_id
required

Content View ID

Validations:

  • Integer


PUT /api/hosts/:host_id/subscriptions/remove_subscriptions

Examples

POST /api/hosts/980191208/subscriptions/remove_subscriptions
{
  "subscriptions": [
    {
      "id": 128914721,
      "quantity": "3"
    }
  ],
  "host_subscription": {
    "subscriptions": [
      {
        "id": 128914721,
        "quantity": "3"
      }
    ]
  }
}
200
{
  "total": 0,
  "subtotal": 0,
  "selectable": 0,
  "page": 1,
  "per_page": 0,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

Params

Param name Description
host_id
required

Id of the host

Validations:

  • Integer

subscriptions
optional

Array of subscriptions to remove

Validations:

  • Must be an Array of nested elements

subscriptions[id]
required

Subscription Pool id

Validations:

  • String

subscriptions[quantity]
optional

If specified, remove the first instance of a subscription with matching id and quantity

Validations:

  • Integer


PUT /api/hosts/:host_id/subscriptions/add_subscriptions
Add a subscription to a host

Examples

POST /api/hosts/980191205/subscriptions/add_subscriptions
{
  "subscriptions": [
    {
      "id": 128914721,
      "quantity": "1"
    }
  ],
  "host_subscription": {
    "subscriptions": [
      {
        "id": 128914721,
        "quantity": "1"
      }
    ]
  }
}
200
{
  "total": 0,
  "subtotal": 0,
  "selectable": 0,
  "page": 1,
  "per_page": 0,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

Params

Param name Description
host_id
required

Id of the host

Validations:

  • Integer

subscriptions
required

Array of subscriptions to add

Validations:

  • Must be an Array of nested elements

subscriptions[id]
required

Subscription Pool id

Validations:

  • String

subscriptions[quantity]
required

Quantity of this subscriptions to add

Validations:

  • Must be a number.


GET /api/hosts/:host_id/subscriptions/product_content
Get content and overrides for the host

Params

Param name Description
host_id
required

Id of the host

Validations:

  • String

content_access_mode_all
optional

Get all content available, not just that provided by subscriptions

Validations:

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

content_access_mode_env
optional

Limit content to just that available in the host's content view version

Validations:

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

search
optional

Search string

Validations:

  • String

page
optional

Page number, starting at 1

Validations:

  • Must be a number.

per_page
optional

Number of results per page to return

Validations:

  • Must be a number.

order
optional

Sort field and order, eg. 'id DESC'

Validations:

  • String

full_result
optional

Whether or not to show all results

Validations:

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

sort_by
optional

Field to sort the results on

Validations:

  • String

sort_order
optional

How to order the sorted results (e.g. ASC for ascending)

Validations:

  • String


PUT /api/hosts/:host_id/subscriptions/content_override
Set content overrides for the host

Examples

PUT /api/hosts/980191147/subscriptions/content_override
{
  "content_overrides": [
    {
      "content_label": "some-content",
      "value": 1
    }
  ],
  "host_subscription": {
    "content_overrides": [
      {
        "content_label": "some-content",
        "value": 1
      }
    ]
  }
}
200
{
  "total": 1,
  "subtotal": 1,
  "selectable": 1,
  "page": 1,
  "per_page": 1,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "enabled": false,
      "product": {
        "id": null,
        "name": "Product 75"
      },
      "content": {
        "id": null,
        "name": "content-name5",
        "label": "some-content",
        "vendor": null,
        "content_type": null,
        "content_url": null,
        "gpg_url": null
      },
      "repositories": [],
      "name": "content-name5",
      "vendor": null,
      "label": "some-content",
      "id": null,
      "type": null,
      "gpgUrl": null,
      "contentUrl": null,
      "archRestricted": null,
      "osRestricted": null,
      "override": "default",
      "overrides": [],
      "enabled_content_override": null,
      "redhat": false
    }
  ]
}

Params

Param name Description
host_id
required

Id of the content host

Validations:

  • String

value
optional

Override to a boolean value or 'default'

Validations:

  • String

content_overrides
optional

Array of Content override parameters

Validations:

  • Must be an Array of nested elements

content_overrides[content_label]
required

Label of the content

Validations:

  • String

content_overrides[value]
optional

Override value. Provide a boolean value if name is 'enabled'

Validations:

  • String

content_overrides[name]
optional

Override key or name. Note if name is not provided the default name will be 'enabled'

Validations:

  • String

content_overrides[remove]
optional

Set true to remove an override and reset it to 'default'

Validations:

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

content_overrides_search
optional

Content override search parameters

Validations:

  • Hash

content_overrides_search[search]
optional

Search string

Validations:

  • String

content_overrides_search[page]
optional

Page number, starting at 1

Validations:

  • Must be a number.

content_overrides_search[per_page]
optional

Number of results per page to return

Validations:

  • Must be a number.

content_overrides_search[order]
optional

Sort field and order, eg. 'id DESC'

Validations:

  • String

content_overrides_search[full_result]
optional

Whether or not to show all results

Validations:

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

content_overrides_search[sort_by]
optional

Field to sort the results on

Validations:

  • String

content_overrides_search[sort_order]
optional

How to order the sorted results (e.g. ASC for ascending)

Validations:

  • String

content_overrides_search[enabled]
optional

Set true to override to enabled; Set false to override to disabled.'

Validations:

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

content_overrides_search[remove]
optional

Set true to remove an override and reset it to 'default'

Validations:

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


GET /api/hosts/:host_id/subscriptions/available_release_versions
Show releases available for the content host

Examples

GET /api/hosts/980191148/subscriptions/available_release_versions
200
{
  "total": 0,
  "subtotal": 0,
  "selectable": 0,
  "page": 1,
  "per_page": 0,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": []
}

Params

Param name Description
host_id
required

id of host

Validations:

  • String


GET /api/hosts/:host_id/subscriptions/enabled_repositories
Show repositories enabled on the host that are known to Katello

Examples

GET /api/hosts/980191149/subscriptions/enabled_repositories
200
{
  "total": 1,
  "subtotal": 1,
  "selectable": 1,
  "page": 1,
  "per_page": 1,
  "error": null,
  "search": null,
  "sort": {
    "by": null,
    "order": null
  },
  "results": [
    {
      "backend_identifier": "fedora_17_acme_dev",
      "relative_path": "ACME_Corporation/dev/fedora_17_dev_label",
      "container_repository_name": null,
      "full_path": "https://centos8-katello-devel.redhat.example.com/pulp/content/ACME_Corporation/dev/fedora_17_dev_label/",
      "library_instance_id": null,
      "version_href": null,
      "remote_href": null,
      "publication_href": null,
      "content_counts": {
        "rpm": 0,
        "erratum": 0,
        "package_group": 0,
        "srpm": 0,
        "module_stream": 0
      },
      "mirroring_policy": "mirror_content_only",
      "id": 841170190,
      "name": "Fedora 17 x86_64",
      "label": "fedora_17_x86_64_label",
      "description": "My description",
      "content_view_versions": [],
      "filters": [],
      "last_sync": null,
      "content_view": {
        "id": 30237652,
        "name": "ACME Default ContentView"
      },
      "content_view_version": {
        "id": 840492357,
        "name": "ACME Default ContentView 1.0",
        "content_view_id": 30237652
      },
      "kt_environment": {
        "id": 292811013,
        "name": "Dev"
      },
      "content_type": "yum",
      "url": "http://myrepo.com",
      "arch": "noarch",
      "os_versions": null,
      "content_id": "1",
      "generic_remote_options": null,
      "major": null,
      "minor": null,
      "product": {
        "id": 785257261,
        "cp_id": "123123123001",
        "name": "Fedora",
        "orphaned": false,
        "redhat": false,
        "sync_plan": null
      },
      "content_label": "fedora",
      "last_sync_words": null
    }
  ]
}

Params

Param name Description
host_id
required

id of host

Validations:

  • String