c8y(1)

πŸ“¦ version 2.56.1, in nixpkgs unstable

πŸ’… c8y(1) β€” the c8y manual, bestie edition ✨

🌸 NAME 🌸

c8y-inventory-count β€” Get managed object count. That's the whole name section, and honestly it ate. πŸ’…

✨ SYNOPSIS ✨

c8y inventory count [flags]

πŸ’– DESCRIPTION πŸ’–

Okay so this one retrieves the total number of managed objects β€” think devices, assets, etc. β€” registered in your tenant. You can also get a subset based on queries, because sometimes you don't want the whole inventory, you want a very specific little slice. It's giving counting, but make it Cumulocity. ✨

πŸŽ€ OPTIONS πŸŽ€

  • --childAdditionId="" β€” search for a specific child addition and list all the groups to which it belongs. πŸ’–
  • --childAssetId="" β€” search for a specific child asset and list all the groups to which it belongs. πŸŽ€
  • --childDeviceId=[] β€” search for a specific child device and list all the groups to which it belongs. πŸ¦‹
  • --fragmentType="" β€” ManagedObject fragment type. 🌸
  • -h, --help[=false] β€” help for count. 🫢
  • --ids=[] β€” list of ids. πŸ”₯
  • --owner="" β€” list of managed objects that are owned by the given username. πŸ‘‘
  • --text="" β€” search for managed objects where a property value is equal to the given one. The following properties are examined: id, type, name, owner, externalIds. πŸ’œ
  • --type="" β€” ManagedObject type. Accepts pipeline. ⭐

πŸ¦‹ OPTIONS INHERITED FROM PARENT COMMANDS πŸ¦‹

  • --abortOnErrors=10 β€” abort batch when reaching the 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 πŸ”₯

Commands are verbatim, bestie β€” copy with confidence. πŸ’–

$ c8y inventory count

Get count of managed objects. ✨

$ c8y inventory count --text myname

Get count of managed objects matching text (using Cumulocity text search algorithm). πŸ”

$ c8y inventory count --type "c8y_Sensor"

Get count of managed objects with a specific type value. 🌑️

$ c8y inventory count --type "c8y_Sensor" --owner "device_mylinuxbox01"

Get count of managed objects with a specific type value and owner. πŸ‘‘

$ c8y inventory count --fragmentType "c8y_IsDevice"

Get total number of devices. πŸ“±

🌈 SEE ALSO 🌈


byeee bestie 🫢 β€” this was the c8y(1) manual, source/version c8y(1), dated Jan 1980. πŸ’–

πŸ“¦ where this page comes from