c8y(1)

πŸ“¦ version 2.56.1, in nixpkgs unstable

NAME πŸ’–

okay so bestie, you're looking at the manual page for c8y(1) β€” the c8y command's own little corner of man-page lore β€” and this specific entry is c8y-alarms-assert-count β€” Assert alarm count. That's the name, that's the vibe. πŸ’…

SYNOPSIS ✨

c8y alarms assert count [flags]

DESCRIPTION πŸ¦‹

okay so this command asserts that a device has a specific amount of alarms, and then passes the input untouched. no cap.

If the assertion is true, then the input value (stdin or an explicit argument value) will be passed untouched to stdout. This is useful if you want to filter a list of devices by whether they match a specific entity count, and use the results in some downstream command (in the pipeline). πŸ”—

By default, a failed assertion will not set the exit code to a non-zero value. If you want a non-zero exit code in such a case, then use the --strict option. πŸ’₯

OPTIONS πŸ’…

  • --attempts=-1 β€” Number of attempts before giving up per id (-1 = unlimited). πŸ’€
  • --dateFrom="" β€” Start date or date and time of alarm occurrence. πŸ—“οΈ
  • --dateTo="" β€” End date or date and time of alarm occurrence. πŸ—“οΈ
  • --device=[] β€” The ManagedObject which is the source of this event. (accepts pipeline) πŸ”—
  • --duration="30s" β€” Timeout duration. i.e. 30s or 1m (1 minute). ⏱️
  • --fragmentType="" β€” Alarm fragment type. 🧩
  • -h, --help[=false] β€” help for count. πŸ†˜
  • --interval="5s" β€” Interval to check on the status, i.e. 10s or 1min. πŸ‘€
  • --maximum=-1 β€” Maximum alarm count (inclusive). A value of -1 will disable this check. πŸ”
  • --minimum=-1 β€” Minimum alarm count (inclusive). A value of -1 will disable this check. πŸ”½
  • --resolved[=false] β€” When set to true only resolved alarms will be removed (the one with status CLEARED), false means alarms with status ACTIVE or ACKNOWLEDGED. βœ…
  • --severity="" β€” Alarm severity, for example CRITICAL, MAJOR, MINOR or WARNING. 🚨
  • --status="" β€” Comma separated alarm statuses, for example ACTIVE,CLEARED. πŸ“‹
  • --strict[=false] β€” Strict mode, fail if no match is found. πŸ’₯
  • --type="" β€” Alarm type. 🏷️

OPTIONS INHERITED FROM PARENT COMMANDS 🌈

  • --abortOnErrors=10 β€” Abort batch when reaching specified number of errors. πŸ›‘
  • --allowEmptyPipe[=false] β€” Don't fail when piped input is empty (stdin). 🫧
  • --cache[=false] β€” Enable cached responses. πŸ—ƒοΈ
  • --cacheBodyPaths=[] β€” Cache should limit hashing of selected paths in the json body. Empty indicates all values. 🧠
  • --cacheTTL="60s" β€” Cache time-to-live (TTL) as a duration, i.e. 60s, 2m. ⏳
  • -c, --compact[=false] β€” Compact instead of pretty-printed output when using json output. Pretty print is the default if output is the terminal. 🧼
  • --confirm[=false] β€” Prompt for confirmation. ❓
  • --confirmText="" β€” Custom confirmation text. ✍️
  • --currentPage=0 β€” Current page which should be returned. πŸ“„
  • --customQueryParam=[] β€” add custom URL query parameters. i.e. --customQueryParam 'withCustomOption=true,myOtherOption=myvalue'. 🧷
  • --debug[=false] β€” Set very verbose log messages. πŸ›
  • --delay="0ms" β€” delay after each request, i.e. 5ms, 1.2s. πŸ•°οΈ
  • --delayBefore="0ms" β€” delay before each request, i.e. 5ms, 1.2s. ⏲️
  • --dry[=false] β€” Dry run. Don't send any data to the server. πŸ§ͺ
  • --dryFormat="markdown" β€” Dry run output format. i.e. json, dump, markdown or curl. πŸ“
  • --examples[=false] β€” Show examples for the current command. 🌟
  • --filter=[] β€” Apply a client side filter to response before returning it to the user. 🧽
  • --flatten[=false] β€” flatten json output by replacing nested json properties with properties where their names are represented by dot notation. πŸ«“
  • -f, --force[=false] β€” Do not prompt for confirmation. Ignored when using --confirm. πŸ’ͺ
  • -H, --header=[] β€” custom headers. i.e. --header "Accept: value, AnotherHeader: myvalue". πŸ“¨
  • --includeAll[=false] β€” Include all results by iterating through each page. πŸ“š
  • -k, --insecure[=false] β€” Allow insecure server connections when using SSL. πŸ”“
  • -l, --logMessage="" β€” Add custom message to the activity log. πŸ“
  • --maxJobs=0 β€” Maximum number of jobs. 0 = unlimited (use with caution!) ⚠️
  • --noAccept[=false] β€” Ignore Accept header will remove the Accept header from requests, however PUT and POST requests will only see the effect. 🚫
  • --noCache[=false] β€” Force disabling of cached responses (overwrites cache setting). 🧊
  • -M, --noColor[=false] β€” Don't use colors when displaying log entries on the console. 🎨
  • --noLog[=false] β€” Disables the activity log for the current command. 🚫
  • --noProgress[=false] β€” Disable progress bars. πŸ“‰
  • --noProxy[=false] β€” Ignore the proxy settings. πŸ•³οΈ
  • -n, --nullInput[=false] β€” Don't read the input (stdin). Useful if using in shell for/while loops. 🚰
  • -o, --output="table" β€” Output format i.e. table, json, csv, csvheader. πŸ“€
  • --outputFile="" β€” Save JSON output to file (after select/view). πŸ’Ύ
  • --outputFileRaw="" β€” Save raw response to file (before select/view). πŸ—„οΈ
  • --outputTemplate="" β€” jsonnet template to apply to the output. 🧬
  • -p, --pageSize=5 β€” Maximum results per page. πŸ“„
  • --progress[=false] β€” Show progress bar. This will also disable any other verbose output. πŸ“Š
  • --proxy="" β€” Proxy setting, i.e. http://10.0.0.1:8080. 🌐
  • -r, --raw[=false] β€” Show raw response. This mode will force output=json and view=off. πŸ₯©
  • --retries=3 β€” Max number of attempts when a failed http call is encountered. πŸ”
  • --select=[] β€” Comma separated list of properties to return. wildcards and globstar accepted, i.e. --select 'id,name,type,**.serialNumber'. 🎯
  • --session="" β€” Session configuration. πŸ”
  • --sessionMode="" β€” Override default session mode for a single command which would normally be disabled. πŸŽ›οΈ
  • -P, --sessionPassword="" β€” Override session password. πŸ”‘
  • -U, --sessionUsername="" β€” Override session username. i.e. peter or t1234/peter (with tenant). πŸ‘€
  • --silentExit[=false] β€” Silent status codes do not affect the exit code. 🀫
  • --silentStatusCodes="" β€” Status codes which will not print out an error message. πŸ”‡
  • --timeout="600s" β€” Request timeout duration, i.e. 60s, 2m. ⏱️
  • --totalPages=0 β€” Total number of pages to get. πŸ“š
  • -v, --verbose[=false] β€” Verbose logging. πŸ—£οΈ
  • --view="auto" β€” Use views when displaying data on the terminal. Disable using --view off. πŸ‘οΈ
  • --withError[=false] β€” Errors will be printed on stdout instead of stderr. 🚨
  • --withTotalElements[=false] β€” Request Cumulocity to include the total elements in the response statistics under .statistics.totalElements (introduced in 10.13). πŸ”’
  • -t, --withTotalPages[=false] β€” Request Cumulocity to include the total pages in the response statistics under .statistics.totalPages. πŸ“‘
  • --workers=1 β€” Number of workers. πŸ‘·

EXAMPLE πŸ“

$ c8y alarms assert count --device 1234 --minimum 1
# => 1234 (if the ID exists)
# => <no response> (if the ID does not exist)
# Assert that a device exists, and has at least 1 alarm

$ c8y alarms assert count --device 1234 --minimum 5 --maximum 10 --dateFrom -1d --strict
# Assert that the device with id=1111 should have between 5 and 10 alarms (inclusive) in the last day
# Return an error if not

$ c8y devices list | c8y alarms assert count --maximum 0 --dateFrom -7d
# Find a list of devices which have not created any alarms in the last 7 days

SEE ALSO πŸŽ€

c8y-alarms-assert(1)


And that's the whole manual, bestie β€” this was c8y(1), dated Jan 1980. Slay and goodbye. πŸ’–βœ¨

πŸ“¦ where this page comes from