Subscription Asset Manager REST API

Red Hat Subscription Management 1

available REST methods

April 30, 2014

Abstract

This guide contains a REST API reference.

1. Subscription Asset Manager REST API

1.1. About

1.1.1. index

GET /api/about

Shows status of system and its subcomponents

This service is only available for authenticated users

1.2. Activation Keys

1.2.1. index

GET /api/activation_keys

List activation keys.

GET /api/organizations/:organization_id/activation_keys

List activation keys.

Table 1. Parameters

Parameter Optional or Required Value
name Optional
lists by activation key name
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.2.2. show

GET /api/activation_keys/:id

Show an activation key

Table 2. Parameters

Parameter Optional or Required Value
name Optional
lists by activation key name
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.2.3. create

POST /api/activation_keys

Create an activation key

Table 3. Parameters

Parameter Optional or Required Value
activation_key required Hash
activation_key[name] required
activation key identifier (alphanum characters, space, _ and -)
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
activation_key[description] Optional , nil allowed String
activation_key[content_view_id] required
content view id
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.2.4. update

PUT /api/activation_keys/:id

Update an activation key

Example 1. Example Code

PUT /api/activation_keys/2/
{
  "activation_key": {
    "environment_id": 9
  }
}
200
{
  "description": null,
  "environment_id": 9,
  "organization_id": 4,
  "system_template_id": null,
  "id": 2,
  "updated_at": "2012-08-10T13:54:45Z",
  "user_id": 1,
  "usage_count": 0,
  "name": "ak1_227e003",
  "created_at": "2012-08-10T13:54:45Z",
  "usage_limit": -1,
  "pools": []
}

Table 4. Parameters

Parameter Optional or Required Value
activation_key required Hash
activation_key[name] Optional
activation key identifier (alphanum characters, space, _ and -)
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
activation_key[description] Optional , nil allowed String
activation_key[content_view_id] Optional
content view id
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
activation_key[environment_id] Optional , nil allowed string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.2.5. destroy

DELETE /api/activation_keys/:id

Destroy an activation key

1.2.6. add pool

POST /api/activation_keys/:id/pools

Create an entitlement pool within an activation key

Example 2. Example Code

POST /api/activation_keys/2/pools
{
  "poolid": "ff8080813910c3d3013910d0e0390063"
}
200
{
  "description": null,
  "environment_id": 9,
  "organization_id": 4,
  "system_template_id": null,
  "id": 2,
  "updated_at": "2012-08-10T13:54:45Z",
  "user_id": 1,
  "usage_count": 0,
  "name": "ak1_227e003",
  "created_at": "2012-08-10T13:54:45Z",
  "usage_limit": -1,
  "pools": []
}

1.2.7. remove pool

DELETE /api/activation_keys/:id/pools/:poolid

Delete an entitlement pool within an activation key

1.2.8. add system groups

POST /api/organizations/:organization_id/activation_keys/:id/system_groups

Add a system group to the key.

1.2.9. remove system groups

DELETE /api/organizations/:organization_id/activation_keys/:id/system_groups

Remove a system group from the key.

1.3. CRLs

1.3.1. index

GET /api/crls

Regenerate X.509 CRL immediately and return them

1.4. Custom Information

1.4.1.  create

POST /api/custom_info/:informable_type/:informable_id

Create custom info

Table 5. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required String
value required String

1.4.2. index

GET /api/custom_info/:informable_type/:informable_id

List custom info

Table 6. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.4.3. show

GET /api/custom_info/:informable_type/:informable_id/:keyname

Show custom info

Table 7. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required
Custom info key
String

1.4.4. update

PUT /api/custom_info/:informable_type/:informable_id/:keyname

Update custom info

Table 8. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required
Custom info key
String
value required String

1.4.5. destroy

DELETE /api/custom_info/:informable_type/:informable_id/:keyname

Delete custom info

Table 9. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required
Custom info key
String

1.5. Organization Default Information

1.5.1. create

POST /api/organizations/:organization_id/default_info/:informable_type

Create default info

Table 10. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required String

1.5.2. destroy

DELETE /api/organizations/:organization_id/default_info/:informable_type/:informable_id/:keyname

Delete default info

Table 11. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
keyname required
Custom info key
String

1.5.3. apply to all

POST /api/organizations/:organization_id/default_info/:informable_type/apply

Apply existing default info on all informable resources

Table 12. Parameters

Parameter Optional or Required Value
informable_type required
name of the resource
String
informable_id required
resource identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
async Optional
directive to run this asynchronously or not
Boolean

1.6. Organizations

1.6.1. index

GET /api/organizations

List organizations

Table 13. Parameters

Parameter Optional or Required Value
name Optional
name for the organization
String
description Optional String
label Optional
label for filtering
String

1.6.2. show

GET /api/organizations/:label

Show an organization

1.6.3. create

POST /api/organizations

Create an organization

Table 14. Parameters

Parameter Optional or Required Value
name required
name for the organization
String
description Optional String

1.6.4. update

PUT /api/organizations/:id

Update an organization

Table 15. Parameters

Parameter Optional or Required Value
organization Optional Hash
organization[name] Optional
name for the organization
String
organization[description] Optional String
organization[service_level] Optional
default service level (SLA)
String

1.6.5. repo discover

POST /api/organizations/:id/repo_discover

Discover Repositories

Table 16. Parameters

Parameter Optional or Required Value
url Optional
base url to perform repo discovery on
String

1.6.6. destroy

DELETE /api/organizations/:id

Destroy an organization. Asynchronous operation.

1.6.7. auto attach all systems

POST /api/organizations/:id/heal

Auto-attach available subscriptions to all systems within an organization. Asynchronous operation.

1.7. Permissions

1.7.1. index

GET /api/roles/:role_id/permissions

List permissions for a role

Table 17. Parameters

Parameter Optional or Required Value
name Optional
filter by name
String
description Optional
filter by description
String
all_verbs Optional
filter by all_verbs flag
Boolean
all_tags Optional
filter by all_flags flag
Boolean

1.7.2. show

GET /api/roles/:role_id/permissions/:id

Show a permission

1.7.3.  create

POST /api/roles/:role_id/permissions

Create a roles permission

Table 18. Parameters

Parameter Optional or Required Value
description Optional , nil allowed String
name required String
organization_id Optional string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
tags Optional
array of tag ids
Array
type required
name of a resource or ‘all’
String
verbs Optional
array of permission verbs
Array
all_tags Optional
True if the permission should use all tags
Boolean
all_verbs Optional
True if the permission should use all verbs
Boolean

1.7.4. destroy

DELETE /api/roles/:role_id/permissions/:id

Destroy a roles permission

1.8. Ping

1.8.1. index

GET /api/ping

Shows status of system and it's subcomponents

This service is only available for authenticated users

1.8.2. server status

GET /api/system_status

Shows version information

This service is also available for unauthenticated users

1.8.3. version

GET /api/version

Shows name and version information

This service is only available for authenticated users

1.9. Role LDAP groups

1.9.1.  create

POST /api/roles/:role_id/ldap_groups

Add group to list of LDAP groups associated with the role

Table 19. Parameters

Parameter Optional or Required Value
name Optional
name of the LDAP group
String

1.9.2. destroy

DELETE /api/roles/:role_id/ldap_groups/:id

Remove group from the list of LDAP groups associated with the role

Table 20. Parameters

Parameter Optional or Required Value
role_id Optional
role identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id Optional
ldap group (name)
String

1.9.3. index

GET /api/roles/:role_id/ldap_groups

List LDAP groups associated with the role

Table 21. Parameters

Parameter Optional or Required Value
role_id Optional
role identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.10. Roles

1.10.1. index

GET /api/roles

List roles

Table 22. Parameters

Parameter Optional or Required Value
name Optional String

1.10.2. show

GET /api/roles/:id

Show a role

1.10.3. create

POST /api/roles

Create a role

Table 23. Parameters

Parameter Optional or Required Value
role required Hash
role[name] required String
role[description] Optional , nil allowed String

1.10.4. destroy

DELETE /api/roles/:id

Destroy a role

1.10.5. available verbs

GET /api/roles/available_verbs

List all available verbs that can be set to roles

Table 24. Parameters

Parameter Optional or Required Value
organization_id Optional
With this option specified the listed tags are scoped to the organization.
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.11. Status

1.11.1. memory

GET /api/status/memory

Counts objects in memory for debug purposes. Can take a while!

1.12. Subscriptions

1.12.1. index

GET /api/systems/:system_id/subscriptions

List subscriptions

Systems subscriptions management.

Table 25. Parameters

Parameter Optional or Required Value
system_id required
System uuid
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.12.2. organization index

GET /api/subscriptions

List subscriptions for the organization.

1.12.3. create

POST /api/systems/:system_id/subscriptions

Create a subscription

Systems subscriptions management.

Table 26. Parameters

Parameter Optional or Required Value
system_id required
System uuid
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
pool required
Subscription Pool uuid
String
quantity required
Number of subscription to use
number.

1.12.4. destroy

DELETE /api/systems/:system_id/subscriptions/:id

Delete a subscription

Systems subscriptions management.

Table 27. Parameters

Parameter Optional or Required Value
id Optional
Entitlement id
number.
system_id required
System uuid
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.12.5. destroy all

DELETE /api/systems/:system_id/subscriptions

Delete all system subscriptions

Systems subscriptions management.

Table 28. Parameters

Parameter Optional or Required Value
system_id required
System uuid
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.12.6. destroy by serial number

DELETE /api/systems/:system_id/subscriptions/serials/:serial_id

Delete a subscription by serial id

Systems subscriptions management.

Table 29. Parameters

Parameter Optional or Required Value
serial_id Optional
Subscription serial id
String
system_id required
System uuid
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.13. System Group Errata

Methods for handling erratas on system group level

1.13.1. index

GET /api/organizations/:organization_id/system_groups/:system_group_id/errata

Get list of errata associated with the group

Table 30. Parameters

Parameter Optional or Required Value
organization_id required
oranization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group_id required
system_group identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
type Optional
Filter errata by type
Must be one of: bugfix, enhancement, security.

1.13.2. create

POST /api/organizations/:organization_id/system_groups/:system_group_id/errata

Install errata remotely

Table 31. Parameters

Parameter Optional or Required Value
organization_id required
oranization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group_id required
system_group identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
errata_ids required
List of errata ids to install
Array

1.14. System Group Packages

Methods for handling packages on system group level

1.14.1. create

POST /api/organizations/:organization_id/system_groups/:system_group_id/packages

Install packages remotely

Example 3. Example Code

POST /api/organizations/org_227e003/system_groups/1/packages
{
  "packages": [
    "cheetah"
  ]
}
202
{
  "task_type": "package_install",
  "id": 1,
  "pulp_id": "0384935e-4216-4d38-9832-6be39e379aba",
  "parameters": {
    "packages": [
      "cheetah"
    ]
  },
  "status_message": "Installing Package...",
  "created_at": "2012-08-10T13:48:24Z",
  "finish_time": null,
  "tasks": [
    {
      "uuid": "0e0f181c-e2f2-11e1-85ad-525400b68f90",
      "start_time": null,
      "result": {
        "errors": [
          null,
          null
        ]
      },
      "id": 15,
      "finish_time": null,
      "progress": null,
      "state": "waiting"
    }
  ],
  "state": "running"
}

Table 32. Parameters

Parameter Optional or Required Value
organization_id required
oranization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group_id required
system_group identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
packages Optional
List of package names
Array
groups Optional
List of package group names
Array

1.14.2. update

PUT /api/organizations/:organization_id/system_groups/:system_group_id/packages

Update packages remotely

Example 4. Example Code

PUT /api/organizations/org_227e003/system_groups/1/packages
{
  "packages": [
    "cheetah"
  ]
}
202
{
  "task_type": "package_update",
  "id": 2,
  "pulp_id": "efe07dec-a694-452e-9de1-a0cf4e429da1",
  "parameters": {
    "packages": [
      "cheetah"
    ]
  },
  "status_message": "Updating Package...",
  "created_at": "2012-08-10T13:48:48Z",
  "finish_time": null,
  "tasks": [
    {
      "uuid": "1cb315cf-e2f2-11e1-a5a0-525400b68f90",
      "start_time": null,
      "result": {
        "errors": [
          null,
          null
        ]
      },
      "id": 16,
      "finish_time": null,
      "progress": null,
      "state": "waiting"
    }
  ],
  "state": "running"
}

Table 33. Parameters

Parameter Optional or Required Value
organization_id required
oranization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group_id required
system_group identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
packages Optional
List of package names
Array
groups Optional
List of package group names
Array

1.14.3. destroy

DELETE /api/organizations/:organization_id/system_groups/:system_group_id/packages

Uninstall packages remotely

Example 5. Example Code

DELETE /api/organizations/org_227e003/system_groups/1/packages
{
  "packages": [
    "cheetah"
  ]
}
202
{
  "task_type": "package_remove",
  "id": 3,
  "pulp_id": "c5846b6b-7415-4fb1-b7ca-1b6fec9d7520",
  "parameters": {
    "packages": [
      "cheetah"
    ]
  },
  "status_message": "Removing Package...",
  "created_at": "2012-08-10T13:48:51Z",
  "finish_time": null,
  "tasks": [
    {
      "uuid": "1e087d07-e2f2-11e1-ae5e-525400b68f90",
      "start_time": null,
      "result": {
        "errors": [
          null,
          null
        ]
      },
      "id": 17,
      "finish_time": null,
      "progress": null,
      "state": "waiting"
    }
  ],
  "state": "running"
}

Table 34. Parameters

Parameter Optional or Required Value
organization_id required
oranization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group_id required
system_group identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
packages Optional
List of package names
Array
groups Optional
List of package group names
Array

1.15. System Groups

1.15.1. index

GET /api/organizations/:organization_id/system_groups

List system groups

Table 35. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
name Optional
System group name to filter by
String

1.15.2. show

GET /api/organizations/:organization_id/system_groups/:id

Show a system group

Table 36. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.3. update

PUT /api/organizations/:organization_id/system_groups/:id

Update a system group

Table 37. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group required Hash
system_group[name] Optional
System group name
String
system_group[description] Optional , nil allowed String
system_group[max_systems] Optional , nil allowed
Maximum number of systems in the group
Integer

1.15.4. systems

GET /api/organizations/:organization_id/system_groups/:id/systems

List systems in the group

Table 38. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.5. add systems

POST /api/organizations/:organization_id/system_groups/:id/add_systems

Add systems to the group

Table 39. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group required Hash
system_group[system_ids] Optional
Array of system ids
Array

1.15.6. remove systems

POST /api/organizations/:organization_id/system_groups/:id/remove_systems

Remove systems from the group

Example 6. Example Code

POST /api/organizations/org_227e003/system_groups/1/remove_systems
{
  "system_group": {
    "system_ids": [
      "3050eb45-0ec4-43ea-8913-83635f06a2b7"
    ]
  }
}
200
[

]

Table 40. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group required Hash
system_group[system_ids] Optional
Array of system ids
Array

1.15.7. history

GET /api/organizations/:organization_id/system_groups/:id/history

History of jobs performed on a system group

Table 41. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.8. show

GET /api/organizations/:organization_id/system_groups/:id/history

History of a job performed on a system group

Example 7. Example Code

GET /api/organizations/org_227e003/system_groups/1/history/1
200
{
  "task_type": "package_install",
  "id": 1,
  "pulp_id": "0384935e-4216-4d38-9832-6be39e379aba",
  "parameters": {
    "packages": [
      "cheetah"
    ]
  },
  "status_message": "Installing Package...",
  "created_at": "2012-08-10T13:48:24Z",
  "finish_time": null,
  "tasks": [
    {
      "uuid": "0e0f181c-e2f2-11e1-85ad-525400b68f90",
      "start_time": "2012-08-10T13:48:24Z",
      "result": {
        "errors": [
          null,
          null
        ]
      },
      "id": 15,
      "finish_time": null,
      "progress": null,
      "state": "running"
    }
  ],
  "state": "running"
}

Table 42. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
job_id Optional
Id of a job for filtering
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.9. create

POST /api/organizations/:organization_id/system_groups

Create a system group

Table 43. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group required Hash
system_group[name] required
System group name
String
system_group[description] Optional , nil allowed String
system_group[max_systems] Optional , nil allowed
Maximum number of systems in the group
Integer

1.15.10. copy

POST /api/organizations/:organization_id/system_groups/:id/copy

Make copy of a system group

Table 44. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group required Hash
system_group[new_name] Optional
System group name
String
system_group[description] Optional , nil allowed String
system_group[max_systems] Optional , nil allowed
Maximum number of systems in the group
Integer

1.15.11. destroy

DELETE /api/organizations/:organization_id/system_groups/:id

Destroy a system group

Table 45. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.12. destroy systems

DELETE /api/organizations/:organization_id/system_groups/:id/destroy_systems

Destroy a system group and its systems

Table 46. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.15.13. update systems

PUT /api/organizations/:organization_id/system_groups/:id/update_systems

Update systems within a system group

Table 47. Parameters

Parameter Optional or Required Value
organization_id required
organization identifier
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
id required
Id of the system group
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group Optional Hash
system_group[content_view_id] Optional
id of the content view to set systems to
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
system_group[environment_id] Optional
id of the enviornment to set systems to
string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.16. Systems

1.16.1. hypervisors update

POST /api/hypervisors

Update the hypervisors information for environment

{ "host-uuid": ["guest-uuid-1", "guest-uuid-2"] }
See virt-who tool for more details.

1.16.2. activate (legacy)

POST /api/consumers

Register a system with activation key (compatibility)

1.16.3. activate

POST /api/organizations/:organization_id/systems

Register a system with activation key

Table 48. Parameters

Parameter Optional or Required Value
activation_keys required String
facts Optional , nil allowed
Key-value hash of system-specific facts
Hash
installedProducts Optional , nil allowed
List of products installed on the system
Array
name required
Name of the system
String
type required
Type of the system, it should always be ‘system’
String
serviceLevel Optional , nil allowed
A service level for auto-healing process, e.g. SELF-SUPPORT
String
location Optional
Physical of the system
String
content_view_id Optional string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
environment_id Optional string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.16.4. regenerate identity certificates

POST /api/consumers/:id

Regenerate consumer identity

Schedules the consumer identity certificate regeneration

Table 49. Parameters

Parameter Optional or Required Value
id Optional
UUID of the consumer
String

1.16.5. update (legacy)

PUT /api/consumers/:id

Update system information (compatibility)

1.16.6. update

PUT /api/systems/:id

Update system information

Table 50. Parameters

Parameter Optional or Required Value
facts Optional , nil allowed
Key-value hash of system-specific facts
Hash
installedProducts Optional , nil allowed
List of products installed on the system
Array
name Optional
Name of the system
String
type Optional
Type of the system, it should always be ‘system’
String
serviceLevel Optional , nil allowed
A service level for auto-healing process, e.g. SELF-SUPPORT
String
location Optional
Physical of the system
String
content_view_id Optional string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..
environment_id Optional string from 2 to 128 characters containting only alphanumeric characters, space, '_', '-' with no leading or trailing space..

1.16.7. checkin (legacy)

PUT /api/consumers/:id/checkin

Update system check-in time (compatibility)

1.16.8. checkin

PUT /api/systems/:id/checkin

Update system check-in time

Table 51. Parameters

Parameter Optional or Required Value
date Optional
check-in time
String

1.16.9. index

GET /api/organizations/:organization_id/systems

List systems in organization

Table 52. Parameters

Parameter Optional or Required Value
name Optional
Filter systems by name
String
pool_id Optional
Filter systems by subscribed pool
String
search Optional
Filter systems by advanced search query
String
uuid Optional
Filter systems by uuid
String

1.16.10. show

GET /api/systems/:id

Show a system

Table 53. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.11. destroy (legacy)

DELETE /api/consumers/:id

Unregister a system (compatibility)

1.16.12. destroy

DELETE /api/systems/:id

Unregister a system

Table 54. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.13. subscription status

GET /api/systems/:id/subscription_status

Show status of subscriptions on the system

Table 55. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.14. pools

GET /api/systems/:id/pools

List pools a system is subscribed to

Table 56. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.15. releases

GET /api/systems/:id/releases

Show releases available for the system

A hint for choosing the right value for the releaseVer param

Table 57. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.16. package profile

GET /api/systems/:id/packages

List packages installed on the system

Table 58. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.17. errata

GET /api/systems/:id/errata

List errata available for the system

Table 59. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.18. upload package profile

PUT /api/consumers/:id/profile

Update installed packages

Table 60. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.19. report

GET /api/organizations/:organization_id/systems/report

Get system reports for the organization

1.16.20. tasks

GET /api/systems/:id/tasks

List async tasks for the system

1.16.21. enabled repos

PUT /api/systems/:id/enabled_repos

Update the information about enabled repositories

Used by katello-agent to keep the information about enabled repositories up to date. This information is then used for computing the errata available for the system.

Example 8. Example Code

PUT /api/systems/82b34fd1-8758-493d-8fa6-5b2b1bf8559d/enabled_repos
{
  "enabled_repos": {
    "repos": [
      {
        "repositoryid": "zoo-enterprise"
      }
    ]
  }
}
200
{
  "processed_ids": [
    "org_manifest_227e003-env_manifest_227e003-Zoo_Enterprise-Zoo_Enterprise_x86_64_6_2"
  ],
  "result": "ok",
  "unknown_labels": [],
  "error_ids": []
}

Table 61. Parameters

Parameter Optional or Required Value
enabled_repos required Hash
enabled_repos[repos] required Array

1.16.22. add system groups

POST /api/systems/:id/system_groups

Replace existing list of system groups

Table 62. Parameters

Parameter Optional or Required Value
system required Hash
system[system_group_ids] required
List of group ids the system belongs to
Array

1.16.23. remove system groups

DELETE /api/systems/:id/system_groups

Remove a system from groups

Table 63. Parameters

Parameter Optional or Required Value
system required Hash
system[system_group_ids] required
List of group ids to add the system to
Array

1.16.24. refresh subscriptions

PUT /api/systems/:id/refresh_subscriptions

Trigger a refresh of subscriptions, auto-attaching if enabled

Table 64. Parameters

Parameter Optional or Required Value
id required
UUID of the system
String

1.16.25. task

GET /api/systems/task/:task_id

Grab a single system task

Table 65. Parameters

Parameter Optional or Required Value
task_id required
Id of the task
String

1.17. Ubercerts

1.17.1. show

GET /api/organizations/:organization_id/uebercert

Show an uber certificate for an organization

Table 66. Parameters

ParameterOptional or RequiredValue
regenerate Optional
When set to ‘True’ certificate will be re-issued
Boolean

1.18. Users

1.18.1. index

GET /api/users

List users

Table 67. Parameters

ParameterOptional or RequiredValue
email Optional
filter by email
String
disabled Optional
filter by disabled flag
Boolean
username Optional
filter by username
String

1.18.2. show

GET /api/users/:id

Show a user

1.18.3. create

POST /api/users

Create a user

Table 68. Parameters

ParameterOptional or RequiredValue
username required String
email required String
password required String
default_environment_id Optional , nil allowed Integer
disabled Optional , nil allowed Boolean

1.18.4. update

PUT /api/users/:id

Update a user

Table 69. Parameters

ParameterOptional or RequiredValue
email Optional String
password Optional String
default_environment_id Optional , nil allowed Integer
disabled Optional , nil allowed Boolean

1.18.5. destroy

DELETE /api/users/:id

Destroy a user

1.18.6. list roles

GET /api/users/:user_id/roles

List roles assigned to a user

1.18.7. sync ldap roles

GET /api/users/sync_ldap_roles

Synchronises roles for all users with LDAP groups

1.18.8. add role

POST /api/users/:user_id/roles

Assign a role to a user

Table 70. Parameters

ParameterOptional or RequiredValue
role_id Optional Integer

1.18.9. remove role

DELETE /api/users/:user_id/roles/:id

Remove user's role

1.18.10. report

GET /api/users/report

Reports all users in the system in a format according to 'Accept' headers. Supported formats are plain text, html, csv, pdf

2. Revision History

Revision History
Revision 1.3-0April 30, 2014Ella Deon Ballard
Initial release.