The content-type-schema command category includes a number of interactions with content type schemas.
These commands can be used to retrieve information on one or more schemas, create new schemas, export and import schemas from an individual hub, as well as archiving and unarchiving schemas.
Run dc-cli content-type-schema --help to get a list of available commands.
Return to README.md for information on other command categories.
The following options are available for all content-type-schema commands.
| Option Name | Type | Description |
|---|---|---|
| --version | [boolean] | Show version number |
| --clientId | [string] [required] |
Client ID for the source hub |
| --clientSecret | [string] [required] |
Client secret for the source hub |
| --hubId | [string] [required] |
Hub ID for the source hub |
| --config | [string] [default: "~/.amplience/dc-cli-config.json"] |
Path to JSON config file |
| --help | [boolean] | Show help |
Archives a content type schema. This hides the schema from the active schema list in the Dynamic Content UI and prevents it being registered as a content type unless unarchived.
dc-cli content-type-schema archive [id]
| Option Name | Type | Description |
|---|---|---|
| --schemaId | [string] | A regex can be provided to select multiple schemas with similar IDs (eg /.header..json/). A single --schemaId option may be given to archive a single content type schema. Multiple --schemaId options may be given to archive multiple content type schemas at the same time. |
| --revertLog | [string] | Path to a log file containing content unarchived in a previous run of the unarchive command. When provided, archives all schemas listed as unarchived in the log file. |
| -f --force |
[boolean] | If present, there will be no confirmation prompt before archiving the found content. |
| -s --silent |
[boolean] | If present, no log file will be produced. |
| --ignoreError | [boolean] | If present, archive requests that fail will not abort the process. |
| --logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type-schema archive
dc-cli content-type-schema archive --schemaId "/Christmas/"
Imports a content type schema from a specified file on the filesystem to the targeted Dynamic Content hub.
dc-cli content-type-schema create
| Option Name | Type | Description |
|---|---|---|
| --schema | [string] [required] |
Content Type Schema source location. |
| --validationLevel | [string] [required] [choices: "SLOT", "CONTENT_TYPE", "PARTIAL"] |
Content Type Schema validation Level |
| --json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type-schema create --schema ./myDirectory/schema/mySlot.json --validationLevel SLOT
Exports content type schemas from the targeted Dynamic Content hub into the specified filesystem location.
More details can be found in export usage.
dc-cli content-type-schema export <dir>
| Option Name | Type | Description |
|---|---|---|
| --schemaId | [string] | The Schema ID of a Content Type Schema to be exported. If no --schemaId option is given, all content type schemas for the hub are exported. A single --schemaId option may be given to export a single content type schema. Multiple --schemaId options may be given to export multiple content type schemas at the same time. |
| -f --force |
[boolean] | Overwrite content type schema without asking. |
| --archived | [boolean] | If present, archived content type schemas will also be considered. |
| --logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type-schema export ./myDirectory/schema
dc-cli content-type-schema export ./myDirectory/schema --schemaId "/Christmas/"
Returns information for a single content type schema. Returns status, validation level, body, schema ID (URI), created & modified by user, created & modified dates, version, and ID.
dc-cli content-type-schema get <id>
| Option Name | Type | Description |
|---|---|---|
| --json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type-schema get foo
Imports content type schemas from the specified filesystem location to the targeted Dynamic Content hub. It is recommended that you check that any content items you intend to import are still valid with any changes you make to your content type schemas. Please see guidelines for making changes to a content type schema for more information.
More details on schema import can be found in import usage.
dc-cli content-type-schema import <dir>
| Option Name | Type | Description |
|---|---|---|
| --logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type-schema import ./myDirectory/schema
Returns information for a all content type schemas in the target hub. Returns ID, schema ID (URI), version, and schema validation level.
dc-cli content-type-schema list
| Option Name | Type | Description |
|---|---|---|
| --json | [boolean] [default: false] |
Render output as JSON |
dc-cli content-type-schema list
Unarchives a content type schema. This returns the schema to the active schema list in the Dynamic Content UI and allows it to be registered as a content type once more.
dc-cli content-type-schema unarchive [id]
| Option Name | Type | Description |
|---|---|---|
| --schemaId | [string] | A regex can be provided to select multiple schemas with similar IDs (eg /.header..json/). A single --schemaId option may be given to unarchive a single content type schema. Multiple --schemaId options may be given to unarchive multiple content type schemas at the same time. |
| --revertLog | [string] | Path to a log file containing content archived in a previous run of the archive command. When provided, unarchives all schemas listed as archived in the log file. |
| -f --force |
[boolean] | If present, there will be no confirmation prompt before unarchiving the found content. |
| -s --silent |
[boolean] | If present, no log file will be produced. |
| --ignoreError | [boolean] | If present, unarchive requests that fail will not abort the process. |
| --logFile | [string] [default: (generated-value)] |
Path to a log file to write to. |
dc-cli content-type-schema unarchive
dc-cli content-type-schema unarchive --schemaId "/Christmas/"