create-policy¶
- subtitle
Create a Replication Policy.
- version
0.9.126
Description¶
Creates a new replication policy with the given name on a specific cluster.
Synopsis¶
create-policy
--cluster-crn <value>
--policy-name <value>
--policy-definition <value>
[--cli-input-json <value>]
[--generate-cli-skeleton]
Options¶
--cluster-crn
(string)
CRN of the cluster where the policy will be created.
--policy-name
(string)
Name of the new policy.
--policy-definition
(object)
Policy creation request definition.
name -> (string)
Name of the new policy.
type -> (string)
Policy replication type.
sourceDataset -> (object)
Extra properties for the source dataset.
hdfsArguments -> (object)
Extra properties for HDFS.
path -> (string)
HDFS path. Mandatory for HDFS policies, otherwise optional.
replicationStrategy -> (string)
Replication strategy.
mapReduceService -> (string)
Name of the mapreduce service.
logPath -> (string)
Job log path.
errorHandling -> (object)
Error handling behavior.
skipChecksumChecks -> (boolean)
Skip checksum checks.
skipListingChecksumChecks -> (boolean)
Skip checksum checks for copy-listing.
abortOnError -> (boolean)
Abort policy on error.
abortOnSnapshotDiffFailures -> (boolean)
Abort policy if there are snapshot diff failures.
preserve -> (object)
Properties to preserve after replication.
blockSize -> (boolean)
Block size.
replicationCount -> (boolean)
Replication count.
permissions -> (boolean)
Permissions.
extendedAttributes -> (boolean)
Extended attributes.
deletePolicy -> (string)
Deletion behavior.
alert -> (object)
Cloudera Manager alerting behavior.
onFailure -> (boolean)
Alert on failure.
onStart -> (boolean)
Alert on start.
onSuccess -> (boolean)
ALert on success.
onAbort -> (boolean)
Alert on abort.
exclusionFilters -> (array)
Exclusion filters in glob format.
item -> (string)
hiveArguments -> (object)
Hive replication arguments.
databasesAndTables -> (array)
Scope of the replication.
item -> (object)
Hive replication scope.
database -> (string)
Database to replicate.
tablesIncludeRegex -> (string)
Regex to match included tables.
tablesExcludeRegex -> (string)
Regex to match excluded tables.
sentryPermissions -> (string)
Include or exclude Sentry permissions.
skipUrlPermissions -> (boolean)
Skip URL permissions.
numThreads -> (integer)
Number of threads to use during replication.
frequencyInSec -> (integer)
Policy’s frequency in seconds.
targetDataset -> (string)
Dataset to replicate to.
cloudCredential -> (string)
Cloud credentials to use if replicating to Cloud.
sourceCluster -> (string)
Name of source cluster in the format: “dataCenterName$cluster name”, for example “DC-Europe$My Source 42.
targetCluster -> (string)
Name of destination cluster in the format: “dataCenterName$cluster name”, for example “DC-US$My Destination 17”.
startTime -> (datetime)
Start time.
endTime -> (datetime)
End time.
distcpMaxMaps -> (integer)
Maximum Map jobs to use for replication.
distcpMapBandwidth -> (integer)
Maximum bandwidth to use for replication.
queueName -> (string)
YARN queue name if not default.
tdeSameKey -> (boolean)
TDE same key.
description -> (string)
Description of the policy.
enableSnapshotBasedReplication -> (boolean)
Enable snapshot based replication.
cloudEncryptionAlgorithm -> (string)
The type of cloud encryption algorithm. Can be used only for HDP/Ambari managed clusters. Supported values are AES256,SSE-KMS.
cloudEncryptionKey -> (string)
Cloud encryption key.
plugins -> (array)
Plugins.
item -> (string)
hiveExternalTableBaseDirectory -> (string)
Hive external table base directory.
cmPolicySubmitUser -> (object)
CM Policy submit user.
userName -> (string)
Username.
sourceUser -> (string)
Source user.
JSON Syntax:
{
"name": "string",
"type": "FS"|"HIVE"|"HBASE",
"sourceDataset": {
"hdfsArguments": {
"path": "string",
"replicationStrategy": "DYNAMIC"|"STATIC",
"mapReduceService": "string",
"logPath": "string",
"errorHandling": {
"skipChecksumChecks": true|false,
"skipListingChecksumChecks": true|false,
"abortOnError": true|false,
"abortOnSnapshotDiffFailures": true|false
},
"preserve": {
"blockSize": true|false,
"replicationCount": true|false,
"permissions": true|false,
"extendedAttributes": true|false
},
"deletePolicy": "KEEP_DELETED_FILES"|"DELETE_TO_TRASH"|"DELETE_PERMANENTLY",
"alert": {
"onFailure": true|false,
"onStart": true|false,
"onSuccess": true|false,
"onAbort": true|false
},
"exclusionFilters": ["string", ...]
},
"hiveArguments": {
"databasesAndTables": [
{
"database": "string",
"tablesIncludeRegex": "string",
"tablesExcludeRegex": "string"
}
...
],
"sentryPermissions": "INCLUDE"|"EXCLUDE",
"skipUrlPermissions": true|false,
"numThreads": integer
}
},
"frequencyInSec": integer,
"targetDataset": "string",
"cloudCredential": "string",
"sourceCluster": "string",
"targetCluster": "string",
"startTime": datetime,
"endTime": datetime,
"distcpMaxMaps": integer,
"distcpMapBandwidth": integer,
"queueName": "string",
"tdeSameKey": true|false,
"description": "string",
"enableSnapshotBasedReplication": true|false,
"cloudEncryptionAlgorithm": "string",
"cloudEncryptionKey": "string",
"plugins": ["string", ...],
"hiveExternalTableBaseDirectory": "string",
"cmPolicySubmitUser": {
"userName": "string",
"sourceUser": "string"
}
}
--cli-input-json
(string)
Performs service operation based on the JSON string provided. The JSON string follows the format provided by
--generate-cli-skeleton
. If other arguments are provided on the command line, the CLI values will override the JSON-provided values.
--generate-cli-skeleton
(boolean)
Prints a sample input JSON to standard output. Note the specified operation is not run if this argument is specified. The sample input can be used as an argument for
--cli-input-json
.
Output¶
clusterCrn -> (string)
The CRN of the input cluster.
requestId -> (string)
The ID of the request. Populated only for Ambari backend.
message -> (string)
The detailed description of the action taken.
status -> (string)
The status of the request.
Form Factors¶
public