bc-cliio export

Export all, or part of, the servers configuration to a JSON or YAML file.

Usage

export [item …] root [(json|yaml|yml)]
export [item …] root file.(json|yaml|yml) [verbose]

where
item one or more item types to include in the export.
Default = calendars, jobs & properties.
acls export acls.
calendars export calendars.
hosts export host acls, if root is /.
jobs export jobs.
properties export properties.
protected export protected users and hosts, if root is /.
all export all the above item types, if root is /. Otherwise, include all the above items except hosts & protected.
root group whose contents to export.
json|yaml|yml output as JSON or YAML to the console. Default = yaml.
file.(json|yaml|yml) output as JSON or YAML to the specified file.
verbose print name of all items exported, instead of counts of each item type exported.

read for acl, calendar & job items.

Examples

Export a group to the console as JSON

As a user with read only access, export the group /examples/webhooks to the console as JSON.

BeyondCron % export /example/webhooks json

{"jobs": [ { "name": "/examples/webhooks/critical-mass", "description": "San Francisco critical mass in 30 mins", "type": "URL", "mode": "ENABLED", "timezone": "US/Pacific", "schedules": [{ "type": "MONTHLY", "day": "FRIDAY", "time": "17:00:00", "position": 1, "last": true }], "properties": [ { "name": "jobName", "value": "/examples/webhooks/critical-mass" }, { "name": "jobDescription", "value": "San Francisco critical mass in 30 mins" } ], "url": "https://hooks.slack.com/services/T052K944E/B077HCJF7/fSMqAZpfirT.......yNdmZgX", "method": "JSON" }, { "name": "/examples/webhooks/private-property", "description": "Call an AWS webhook with a private header API key", "type": "URL", "mode": "ENABLED", "timezone": "Asia/Tokyo", "schedules": [{ "type": "REPEAT", "period": "30 minutes", "epoch": 1440920870665 }], "properties": [ { "name": "jobName", "value": "/examples/webhooks/private-property" }, { "name": "jobDescription", "value": "Call an AWS webhook with a private header API key" }, { "name": "hp:x-api-key", "value": "********" } ], "url": "https://5s...6f.execute-api.us-west-2.amazonaws.com/prod/random-result", "method": "JSON" } ]

the value of the property x-api-key in job /examples/webhooks/private-property, is masked since the user does not have write access to the job.

Export a group to the console as YAML

Export the same group to the console as YAML.

BeyondCron % export /example/webhooks

jobs: - name: /examples/webhooks/critical-mass description: San Francisco critical mass in 30 mins type: URL mode: ENABLED timezone: US/Pacific schedules: - type: MONTHLY day: FRIDAY time: '17:00:00' position: 1 last: true properties: - {name: jobName, value: /examples/webhooks/critical-mass} - {name: jobDescription, value: San Francisco critical mass in 30 mins} url: https://hooks.slack.com/services/T052K944E/B077HCJF7/fSMqAZpfirT.......yNdmZgX method: JSON - name: /examples/webhooks/private-property description: Call an AWS webhook with a private header API key type: URL mode: ENABLED timezone: Asia/Tokyo schedules: - type: REPEAT period: 30 minutes epoch: 1440920870665 properties: - {name: jobName, value: /examples/webhooks/private-property} - {name: jobDescription, value: Call an AWS webhook with a private header API key} - {name: 'hp:x-api-key', value: '********'} url: https://5s...6f.execute-api.us-west-2.amazonaws.com/prod/random-result method: JSON

Export a group to a file

Export the same group to the a file as YAML, printing the names of each item exported.

BeyondCron % export /example/webhooks /…/webhooks.yaml verbose

Exported: - /examples/webhooks/critical-mass (JOB) - /examples/webhooks/private-property (JOB)

Export entire configuration to a file

Export the entire configuration to a JSON file, printing a count of each item exported.

BeyondCron % export all / /…/server.json

Exported 8 Calendars & 33 Jobs.

See also