Introduction
This document describes the Cloudera Manager REST API. All requests and responses are presented in Javascript Object Notation (JSON).
The API resources listed below follow standard Create-Read-Update-Delete (CRUD) semantics where the HTTP request path defines the entity to be acted on and the HTTP method expresses the type of action to perform.
HTTP Method | Operation |
---|---|
POST | Create entries |
GET | Read entries |
PUT | Update or edit entries |
DELETE | Delete entries |
All collections in the API use plural names, 'users', instead of the singular, 'user'. To address a specific user in the system, expand the URL path to include the user identifier. For example, '/users/foo' identifies user 'foo' and '/users/bar' identifies user 'bar'.
Collection | POST (create) | GET (read) | PUT (update) | DELETE (delete) |
---|---|---|---|---|
/users | Create a new user | List all users in the system | Bulk update all users | Delete all users |
/users/foo | error | Read information about user 'foo' | If user 'foo' exists, update their information; otherwise, error. | Delete user 'foo' |
Keep in mind that not all collections support all operations. For example, events in the system are read-only; you cannot create new events with the API.
You can list the entries in a collection using one of two views: 'summary' or 'full'. The default 'summary' view provides the core information about each entry. The 'full' view is more heavyweight and provides a fully expanded view of each entry. The view is controlled by a query parameter called 'view' e.g. 'GET /users?view=full'.
HTTP requests should set the "Content-Type" header to "application/json" for most calls, unless specified otherwise.
Authentication
The Cloudera Manager API uses HTTP basic access authentication. It accepts the same user credentials as the web interface. Different users may have different levels of access, as defined by their roles. (See the user management API calls for more.) With every authenticated request, the server returns a session cookie, which can be subsequently used for authentication.
Error Code
The API returns HTTP code in the 400s and 500s upon errors:
- 400 — Invalid request parameters; Malformed requests
- 401 — Authentication failure
- 403 — Authorization failure
- 404 — Object not found
- 500 — Internal API error
- 503 — Response temporarily unavailable; caller should retry later
See /tools/echoError for a discussion on the body of an error response.
API Usage Tutorial
API Version
The API can be queried for the latest version it supports. By making a GET request to the '/version' URL, a string will be returned with the highest supported version (for example, "v2").
Note that servers that only support API v1 do not support this call. In that case, a 404 error will be returned, and can be used to detect that the server only supports v1.
The version should be prepended to the path of the REST resources listed below. The documentation of the different resources lists the version which added the particular functionality.
REST Resources
This API supports a Representational State Transfer (REST) model for accessing a set of resources through a fixed set of operations. The following resources are accessible through the RESTful model:
- /audits
- /batch
- /clusters
- /clusters/{clusterName}
- /clusters/{clusterName}/autoAssignRoles
- /clusters/{clusterName}/autoConfigure
- /clusters/{clusterName}/clientConfig
- /clusters/{clusterName}/commands
- /clusters/{clusterName}/commands/deployClientConfig
- /clusters/{clusterName}/commands/deployClusterClientConfig
- /clusters/{clusterName}/commands/enterMaintenanceMode
- /clusters/{clusterName}/commands/exitMaintenanceMode
- /clusters/{clusterName}/commands/firstRun
- /clusters/{clusterName}/commands/inspectHosts
- /clusters/{clusterName}/commands/poolsRefresh
- /clusters/{clusterName}/commands/refresh
- /clusters/{clusterName}/commands/restart
- /clusters/{clusterName}/commands/rollingRestart
- /clusters/{clusterName}/commands/start
- /clusters/{clusterName}/commands/stop
- /clusters/{clusterName}/commands/upgradeCdh
- /clusters/{clusterName}/commands/upgradeServices
- /clusters/{clusterName}/hosts
- /clusters/{clusterName}/hosts/{hostId}
- /clusters/{clusterName}/hostTemplates
- /clusters/{clusterName}/hostTemplates/{hostTemplateName}
- /clusters/{clusterName}/hostTemplates/{hostTemplateName}/commands/applyHostTemplate
- /clusters/{clusterName}/parcels
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/activate
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/cancelDistribution
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/cancelDownload
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/deactivate
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/removeDownload
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startDistribution
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startDownload
- /clusters/{clusterName}/parcels/products/{product}/versions/{version}/commands/startRemovalOfDistribution
- /clusters/{clusterName}/parcels/usage
- /clusters/{clusterName}/services
- /clusters/{clusterName}/services/{serviceName}
- /clusters/{clusterName}/services/{serviceName}/activities
- /clusters/{clusterName}/services/{serviceName}/activities/{activityId}
- /clusters/{clusterName}/services/{serviceName}/activities/{activityId}/children
- /clusters/{clusterName}/services/{serviceName}/activities/{activityId}/metrics
- /clusters/{clusterName}/services/{serviceName}/activities/{activityId}/similar
- /clusters/{clusterName}/services/{serviceName}/clientConfig
- /clusters/{clusterName}/services/{serviceName}/commands
- /clusters/{clusterName}/services/{serviceName}/commands/{commandName}
- /clusters/{clusterName}/services/{serviceName}/commands/createOozieDb
- /clusters/{clusterName}/services/{serviceName}/commands/createSolrHdfsHomeDir
- /clusters/{clusterName}/services/{serviceName}/commands/createSqoopUserDir
- /clusters/{clusterName}/services/{serviceName}/commands/decommission
- /clusters/{clusterName}/services/{serviceName}/commands/deployClientConfig
- /clusters/{clusterName}/services/{serviceName}/commands/disableJtHa
- /clusters/{clusterName}/services/{serviceName}/commands/disableRmHa
- /clusters/{clusterName}/services/{serviceName}/commands/enableJtHa
- /clusters/{clusterName}/services/{serviceName}/commands/enableRmHa
- /clusters/{clusterName}/services/{serviceName}/commands/enterMaintenanceMode
- /clusters/{clusterName}/services/{serviceName}/commands/exitMaintenanceMode
- /clusters/{clusterName}/services/{serviceName}/commands/firstRun
- /clusters/{clusterName}/services/{serviceName}/commands/hbaseCreateRoot
- /clusters/{clusterName}/services/{serviceName}/commands/hbaseUpgrade
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsCreateTmpDir
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableAutoFailover
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableHa
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsDisableNnHa
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableAutoFailover
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableHa
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsEnableNnHa
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsFailover
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsFinalizeRollingUpgrade
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsRollEdits
- /clusters/{clusterName}/services/{serviceName}/commands/hdfsUpgradeMetadata
- /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveUserDir
- /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateHiveWarehouse
- /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabase
- /clusters/{clusterName}/services/{serviceName}/commands/hiveCreateMetastoreDatabaseTables
- /clusters/{clusterName}/services/{serviceName}/commands/hiveUpdateMetastoreNamenodes
- /clusters/{clusterName}/services/{serviceName}/commands/hiveUpgradeMetastore
- /clusters/{clusterName}/services/{serviceName}/commands/hueCreateHiveWarehouse
- /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabase
- /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateCatalogDatabaseTables
- /clusters/{clusterName}/services/{serviceName}/commands/impalaCreateUserDir
- /clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaHa
- /clusters/{clusterName}/services/{serviceName}/commands/impalaDisableLlamaRm
- /clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaHa
- /clusters/{clusterName}/services/{serviceName}/commands/impalaEnableLlamaRm
- /clusters/{clusterName}/services/{serviceName}/commands/importMrConfigsIntoYarn
- /clusters/{clusterName}/services/{serviceName}/commands/initSolr
- /clusters/{clusterName}/services/{serviceName}/commands/installOozieShareLib
- /clusters/{clusterName}/services/{serviceName}/commands/oozieDisableHa
- /clusters/{clusterName}/services/{serviceName}/commands/oozieEnableHa
- /clusters/{clusterName}/services/{serviceName}/commands/oozieUpgradeDb
- /clusters/{clusterName}/services/{serviceName}/commands/recommission
- /clusters/{clusterName}/services/{serviceName}/commands/restart
- /clusters/{clusterName}/services/{serviceName}/commands/rollingRestart
- /clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabase
- /clusters/{clusterName}/services/{serviceName}/commands/sentryCreateDatabaseTables
- /clusters/{clusterName}/services/{serviceName}/commands/sentryUpgradeDatabaseTables
- /clusters/{clusterName}/services/{serviceName}/commands/sqoopUpgradeDb
- /clusters/{clusterName}/services/{serviceName}/commands/start
- /clusters/{clusterName}/services/{serviceName}/commands/stop
- /clusters/{clusterName}/services/{serviceName}/commands/switchToMr2
- /clusters/{clusterName}/services/{serviceName}/commands/yarnApplicationDiagnosticsCollection
- /clusters/{clusterName}/services/{serviceName}/commands/yarnCreateJobHistoryDirCommand
- /clusters/{clusterName}/services/{serviceName}/commands/yarnFormatStateStore
- /clusters/{clusterName}/services/{serviceName}/commands/yarnNodeManagerRemoteAppLogDirCommand
- /clusters/{clusterName}/services/{serviceName}/commands/zooKeeperCleanup
- /clusters/{clusterName}/services/{serviceName}/commands/zooKeeperInit
- /clusters/{clusterName}/services/{serviceName}/commandsByName
- /clusters/{clusterName}/services/{serviceName}/config
- /clusters/{clusterName}/services/{serviceName}/impalaQueries
- /clusters/{clusterName}/services/{serviceName}/impalaQueries/{queryId}
- /clusters/{clusterName}/services/{serviceName}/impalaQueries/{queryId}/cancel
- /clusters/{clusterName}/services/{serviceName}/metrics
- /clusters/{clusterName}/services/{serviceName}/nameservices
- /clusters/{clusterName}/services/{serviceName}/nameservices/{nameservice}
- /clusters/{clusterName}/services/{serviceName}/nameservices/{nameservice}/metrics
- /clusters/{clusterName}/services/{serviceName}/replications
- /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}
- /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/history
- /clusters/{clusterName}/services/{serviceName}/replications/{scheduleId}/run
- /clusters/{clusterName}/services/{serviceName}/reports/hdfsUsageReport
- /clusters/{clusterName}/services/{serviceName}/reports/mrUsageReport
- /clusters/{clusterName}/services/{serviceName}/roleCommands/{commandName}
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsBootstrapStandBy
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsEnterSafemode
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFinalizeMetadataUpgrade
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsFormat
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeAutoFailover
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsInitializeSharedDir
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsLeaveSafemode
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hdfsSaveNamespace
- /clusters/{clusterName}/services/{serviceName}/roleCommands/hueSyncDb
- /clusters/{clusterName}/services/{serviceName}/roleCommands/jmapDump
- /clusters/{clusterName}/services/{serviceName}/roleCommands/jmapHisto
- /clusters/{clusterName}/services/{serviceName}/roleCommands/jstack
- /clusters/{clusterName}/services/{serviceName}/roleCommands/lsof
- /clusters/{clusterName}/services/{serviceName}/roleCommands/refresh
- /clusters/{clusterName}/services/{serviceName}/roleCommands/restart
- /clusters/{clusterName}/services/{serviceName}/roleCommands/start
- /clusters/{clusterName}/services/{serviceName}/roleCommands/stop
- /clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperCleanup
- /clusters/{clusterName}/services/{serviceName}/roleCommands/zooKeeperInit
- /clusters/{clusterName}/services/{serviceName}/roleConfigGroups
- /clusters/{clusterName}/services/{serviceName}/roleConfigGroups/{roleConfigGroupName}
- /clusters/{clusterName}/services/{serviceName}/roleConfigGroups/{roleConfigGroupName}/config
- /clusters/{clusterName}/services/{serviceName}/roleConfigGroups/{roleConfigGroupName}/roles
- /clusters/{clusterName}/services/{serviceName}/roleConfigGroups/roles
- /clusters/{clusterName}/services/{serviceName}/roles
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/enterMaintenanceMode
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/commands/exitMaintenanceMode
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/config
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/full
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stderr
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/logs/stdout
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/metrics
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/process
- /clusters/{clusterName}/services/{serviceName}/roles/{roleName}/process/configFiles/{configFileName }
- /clusters/{clusterName}/services/{serviceName}/roleTypes
- /clusters/{clusterName}/services/{serviceName}/snapshots/policies
- /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName}
- /clusters/{clusterName}/services/{serviceName}/snapshots/policies/{policyName}/history
- /clusters/{clusterName}/services/{serviceName}/yarnApplications
- /clusters/{clusterName}/services/{serviceName}/yarnApplications/{applicationId}/kill
- /clusters/{clusterName}/services/{serviceName}/yarnApplications/attributes
- /clusters/{clusterName}/serviceTypes
- /cm/allHosts/config
- /cm/commands
- /cm/commands/collectDiagnosticData
- /cm/commands/generateCredentials
- /cm/commands/hostInstall
- /cm/commands/hostsDecommission
- /cm/commands/hostsRecommission
- /cm/commands/hostsStartRoles
- /cm/commands/importAdminCredentials
- /cm/commands/importKerberosPrincipal
- /cm/commands/inspectHosts
- /cm/config
- /cm/deployment
- /cm/kerberosPrincipals
- /cm/license
- /cm/licensedFeatureUsage
- /cm/log
- /cm/peers
- /cm/peers/{peerName}
- /cm/peers/{peerName}/commands/test
- /cm/service
- /cm/service/autoAssignRoles
- /cm/service/autoConfigure
- /cm/service/commands
- /cm/service/commands/restart
- /cm/service/commands/start
- /cm/service/commands/stop
- /cm/service/config
- /cm/service/roleCommands/jmapDump
- /cm/service/roleCommands/jmapHisto
- /cm/service/roleCommands/jstack
- /cm/service/roleCommands/lsof
- /cm/service/roleCommands/restart
- /cm/service/roleCommands/start
- /cm/service/roleCommands/stop
- /cm/service/roleConfigGroups
- /cm/service/roleConfigGroups/{roleConfigGroupName}
- /cm/service/roleConfigGroups/{roleConfigGroupName}/config
- /cm/service/roleConfigGroups/{roleConfigGroupName}/roles
- /cm/service/roles
- /cm/service/roles/{roleName}
- /cm/service/roles/{roleName}/commands
- /cm/service/roles/{roleName}/config
- /cm/service/roles/{roleName}/logs/full
- /cm/service/roles/{roleName}/logs/stacks
- /cm/service/roles/{roleName}/logs/stacksBundle
- /cm/service/roles/{roleName}/logs/stderr
- /cm/service/roles/{roleName}/logs/stdout
- /cm/service/roleTypes
- /cm/trial/begin
- /cm/trial/end
- /cm/version
- /commands/{commandId}
- /commands/{commandId}/abort
- /events
- /events/{eventId}
- /hosts
- /hosts/{hostId}
- /hosts/{hostId}/commands/enterMaintenanceMode
- /hosts/{hostId}/commands/exitMaintenanceMode
- /hosts/{hostId}/config
- /hosts/{hostId}/metrics
- /timeseries
- /timeseries/dashboards
- /timeseries/dashboards/{dashboardName}
- /timeseries/schema
- /tools/echo
- /tools/echoError
- /users
- /users/{userName}
There is also a WADL document describing the REST API.
Data Model
All endpoints act on a common set of data. The Cloudera Manager API uses JSON.
Data Elements
- activity
- activityList
- apiDashboard
- apiDashboardList
- audit
- auditList
- batchRequest
- batchRequestElement
- batchResponse
- batchResponseElement
- bulkCommandList
- cdhUpgradeArgs
- cluster
- clusterList
- clusterRef
- cmPeer
- cmPeerList
- cmVersionInfo
- collectDiagnosticDataArgs
- command
- commandList
- commandMetadata
- commandMetadataList
- config
- configList
- deployment
- disableJtHaArgs
- disableLlamaHaArgs
- disableOozieHaArgs
- disableRmHaArgs
- echoMessage
- enableJtHaArgs
- enableLlamaHaArgs
- enableLlamaRmArgs
- enableNnHaArgs
- enableOozieHaArgs
- enableRmHaArgs
- event
- eventQueryResult
- hbaseSnapshot
- hbaseSnapshotError
- hbaseSnapshotPolicyArguments
- hbaseSnapshotResult
- hdfsDisableHaArgs
- hdfsDisableNnHaArgs
- hdfsFailoverArgs
- hdfsHaArgs
- hdfsReplicationArguments
- hdfsReplicationCounter
- hdfsReplicationResult
- hdfsSnapshot
- hdfsSnapshotError
- hdfsSnapshotPolicyArguments
- hdfsSnapshotResult
- hdfsUsageReport
- hdfsUsageReportRow
- healthCheck
- hiveReplicationArguments
- hiveReplicationError
- hiveReplicationResult
- hiveTable
- host
- hostInstallArgs
- hostList
- hostNames
- hostRef
- hostRefList
- hostTemplate
- hostTemplateList
- impalaCancelResponse
- impalaQuery
- impalaQueryDetailsResponse
- impalaQueryResponse
- impalaUDF
- jnArgs
- license
- licensedFeatureUsage
- metric
- metricData
- metricList
- metricSchema
- metricSchemaList
- mr2AppInformation
- mrUsageReport
- mrUsageReportRow
- nameservice
- nameserviceList
- parcel
- parcelList
- parcelRef
- parcelUsage
- parcelUsageHost
- parcelUsageParcel
- parcelUsageRack
- parcelUsageRole
- principals
- process
- replicationCommand
- replicationCommandList
- replicationSchedule
- replicationScheduleList
- restartClusterArgs
- role
- roleConfigGroup
- roleConfigGroupList
- roleConfigGroupRef
- roleList
- roleNames
- roleRef
- roleTypeConfig
- roleTypeList
- rollEditsArgs
- rollingRestartArgs
- rollingRestartClusterArgs
- service
- serviceConfig
- serviceList
- serviceRef
- serviceTypeList
- snapshotCommand
- snapshotCommandList
- snapshotPolicy
- snapshotPolicyList
- timeSeries
- timeSeriesAggregateStatistics
- timeSeriesCrossEntityMetadata
- timeSeriesData
- timeSeriesMetaData
- timeSeriesResponse
- timeSeriesResponseList
- user
- userList
- yarnApplication
- yarnApplicationAttribute
- yarnApplicationAttributeList
- yarnApplicationDiagnosticsCollectionArgs
- yarnApplicationResponse
- yarnKillResponse