{"id":39234785,"url":"https://github.com/jci-metasys/powershell-metasysrestclient","last_synced_at":"2026-01-17T23:45:38.099Z","repository":{"id":40992066,"uuid":"285854944","full_name":"jci-metasys/powershell-metasysrestclient","owner":"jci-metasys","description":"A cross platform light weight powershell module to enable easy cli access to the Metasys REST API. ","archived":false,"fork":false,"pushed_at":"2024-09-12T14:13:51.000Z","size":613,"stargazers_count":2,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-13T02:26:58.759Z","etag":null,"topics":["cli","powershell","rest-api"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jci-metasys.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-08-07T14:56:39.000Z","updated_at":"2024-09-12T14:13:55.000Z","dependencies_parsed_at":"2024-09-13T00:38:57.041Z","dependency_job_id":null,"html_url":"https://github.com/jci-metasys/powershell-metasysrestclient","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/jci-metasys/powershell-metasysrestclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jci-metasys%2Fpowershell-metasysrestclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jci-metasys%2Fpowershell-metasysrestclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jci-metasys%2Fpowershell-metasysrestclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jci-metasys%2Fpowershell-metasysrestclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jci-metasys","download_url":"https://codeload.github.com/jci-metasys/powershell-metasysrestclient/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jci-metasys%2Fpowershell-metasysrestclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28522313,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T22:11:28.393Z","status":"ssl_error","status_checked_at":"2026-01-17T22:11:27.841Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","powershell","rest-api"],"created_at":"2026-01-17T23:45:37.250Z","updated_at":"2026-01-17T23:45:38.088Z","avatar_url":"https://github.com/jci-metasys.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MetasysRestClient\n\n[![Unit Tests](https://github.com/jci-metasys/powershell-metasysrestclient/actions/workflows/test.yml/badge.svg)](https://github.com/jci-metasys/powershell-metasysrestclient/actions/workflows/test.yml)\n\nA PowerShell module that sends HTTPS request to a Metasys device running Metasys\nREST API.\n\nFeatures:\n\n- Establishes a \"session\" with a Metasys device so you don't need to send\n  credentials on each call or explicitly manage the access token\n- Sets boiler plate like `Content-Type` header for you on each request\n- Securely stores credentials in secret vault after your first successful login\n  to a Metasys device (requires SecretManagement module and a Secret Vault to be\n  installed and registered)\n- Provides helper functions to inspect all the results of the previous command\n- Provides helper functions to deal with responses as PowerShell objects rather\n  than JSON\n- Provides helper functions to make calling common methods even easier (in\n  progress)\n\n## Dependencies\n\n- Powershell Core for your OS: See the\n  [repository](https://github.com/powershell/powershell).\n\n  **Note:** Windows PowerShell is not supported\n\n- (Optional) Microsoft.PowerShell.SecretManagement\n- (Optional) Microsoft.PowerShell.SecretStore (or other SecretVault\n  implementation)\n\n## Credential Management\n\nIf you install and configure SecretManagement and a Secret Vault, your\ncredentials will be securely saved between sessions. See\n[Secret Management](docs/secret-management.md).\n\n## Prerequisites\n\nThis guide assumes you have some familiarity with REST APIs in general and the\nMetasys REST API specifically.\n\nSee the Documentation for the Metasys REST API for more information on what\nendpoints are available and what their payloads look like.\n\nTo become really proficient with this tool you'll want to learn PowerShell. But\nthis guide doesn't assume you know PowerShell and the documentation will be\nupdated to help you do the most common actions.\n\n## Metasys REST API Versions\n\nExamples in this README are from `v4` of the API. However, Metasys Rest Client\nworks with `v2`, `v3` and `v5` as well.\n\n## PowerShell References\n\n- [Learning PowerShell](https://github.com/PowerShell/PowerShell/tree/master/docs/learning-powershell)\n- [PowerShell Beginner’s Guide](https://github.com/PowerShell/PowerShell/blob/master/docs/learning-powershell/powershell-beginners-guide.md)\n\n## Installation\n\nFrom a powershell command prompt:\n\n```powershell\nInstall-Module MetasysRestClient -Repository PSGallery\n```\n\n## Help\n\nYou can discover the commands in the module by ensuring it has been loaded and\nthen inspecting it's contents:\n\n```powershell\nPS \u003e Import-Module MetasysRestClient\nPS \u003e (Get-Module MetasysRestClient).ExportedCommands\n\nKey                                 Value\n---                                 -----\nClear-MetasysEnvVariables           Clear-MetasysEnvVariables\nConnect-MetasysAccount              Connect-MetasysAccount\nGet-LastMetasysHeadersAsObject      Get-LastMetasysHeadersAsObject\nGet-LastMetasysResponseBodyAsObject Get-LastMetasysResponseBodyAsObject\nGet-SavedMetasysPassword            Get-SavedMetasysPassword\nGet-SavedMetasysUsers               Get-SavedMetasysUsers\nInvoke-MetasysMethod                Invoke-MetasysMethod\nRemove-SavedMetasysPassword         Remove-SavedMetasysPassword\nSet-SavedMetasysPassword            Set-SavedMetasysPassword\nShow-LastMetasysAccessToken         Show-LastMetasysAccessToken\nShow-LastMetasysFullResponse        Show-LastMetasysFullResponse\nShow-LastMetasysHeaders             Show-LastMetasysHeaders\nShow-LastMetasysResponseBody        Show-LastMetasysResponseBody\nShow-LastMetasysStatus              Show-LastMetasysStatus\ncma                                 cma\nimm                                 imm\n```\n\nYou can find help on any of the commands using `help`\n\n```powershell\nhelp Invoke-MetasysMethod\n```\n\n## Quick Start\n\nThis section will show you the basics of using `Invoke-MetasysMethod`. We will\ncover\n\n- Starting a Session\n- Discovering objects\n- Reading an object and an attribute\n- Sending a command\n- Creating an object\n\n### Starting a Session\n\nTo get started you need to get logged into a site.\n\nTo do this, call `Connect-MetasysAccount` with no parameters. You'll be prompted\nfor your `Metasys host`, `UserName` and `Password`.\n\n```powershell\nPS \u003e Connect-MetasysAccount\n\nMetasys host: welchoas\nUserName: api\nPassword: *********\n```\n\n\u003e [!Tip]\\\n\u003e If you wish to control which version of the REST API will be used, you can specify\n\u003e it with the `-Version` switch.\n\n```powershell\nConnect-MetasysAccount -Version 3\n```\n\nIf you don't specify a version, then `Connect-MetasysAccount` will look for the\nenvironment variable `$env:METASYS_DEFAULT_API_VERSION`. If that variable is not\nset, it will default to a version. At the time of writing, that version is 5.\n\nWhatever version is used in the call to `Connect-MetasysAccount` will be used\nfor all other calls in the current session (unless overridden with `-Version`\nswitch or by specifying a full URL).\n\n#### Starting a Session without Prompts\n\nIf you want to start a session without being prompted for `Metasys Host`,\n`UserName`, and `Password` you can supply them all as parameters. You should\nalso specify the `Version` on this first call to be explicit about which version\nof the API you want. The default value of this parameter is `5`.\n\n```powershell\n$password = Get-SavedMetasysPassword -MetasysHost welchoas -UserName api\nConnect-MetasysAccount -MetasysHost welchoas -UserName api -Password $password -Version 3\n```\n\nThis will start a session using version 3 of the API. You don't need to specify\nthe version for other calls made during this session. `Invoke-MetasysMethod`\nremembers what version you requested and uses it for future calls. The\n`Password` parameter takes as input a `SecureString`. Typically you'd want to\nretrieve it from some secret storage that returns a `SecureString`. In this\nexample we looked it up using `Get-SavedMetasysPassword`. See\n[SecretManagement](docs/secret-management.md) for more details.\n\n#### Starting a Session using Aliases\n\nStarting with version 2.2.0-rc2 you can use a\n[Configuration File](#configuration) to define aliases and other parameters for\nall of your hosts. Assuming I had a file in place for a host named\n`r12adsdaily.cg.na.jci.com` with an alias of `r12` I could type just the\nfollowing to connect to that host.\n\n```powershell\ncma -Alias r12\n```\n\nOr since `Alias` is a positional parameter just type\n\n```powershell\ncma r12\n```\n\n\u003e [!Note]\\\n\u003e You'll still be prompted for a password if this is the first time you are connecting\n\u003e to the host or if you don't have a secret store configured.\n\n### Reading Information (GET)\n\nWhen you want to read information from Metasys you'll normally be doing a `GET`\nrequest. These are the easiest to work with because they only require a URL and\nnothing else. You can use a relative or absolute url.\n\n```powershell\nInvoke-MetasysMethod /objects\n```\n\nThis will invoke the `/objects` endpoint and display the response body. Notice\nthat we were not prompted for any information because we established a session\nin the previous step. (If we had skipped that step then we would have been given\nan error message.)\n\n\u003c!-- markdownlint-disable no-inline-html --\u003e\n\n\u003cdetails\u003e\u003csummary\u003eClick to see the response\u003c/summary\u003e\n\n```json\n{\n  \"self\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/objects?flatten=false\u0026includeExtensions=true\u0026includeInternal=false\u0026depth=1\",\n  \"items\": [\n    {\n      \"self\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n      \"parentUrl\": null,\n      \"networkDeviceUrl\": null,\n      \"pointsUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/points\",\n      \"objectsUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/objects\",\n      \"alarmsUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/alarms\",\n      \"auditsUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/audits\",\n      \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962/trendedAttributes\",\n      \"itemReference\": \"welchoas:welchoas/$site\",\n      \"hasChildrenMatchingQuery\": true,\n      \"name\": \"Site\",\n      \"id\": \"896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n      \"objectType\": \"objectTypeEnumSet.siteClass\",\n      \"classification\": \"site\",\n      \"items\": [\n        {\n          \"self\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d\",\n          \"parentUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"networkDeviceUrl\": \"https://welchoas/api/v4/networkDevices/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"pointsUrl\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d/points\",\n          \"objectsUrl\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d/objects\",\n          \"alarmsUrl\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d/alarms\",\n          \"auditsUrl\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d/audits\",\n          \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/c8dd833e-427b-55a1-9f7d-c4f09ea3524d/trendedAttributes\",\n          \"itemReference\": \"welchoas:welchoas/$site.UserTrees\",\n          \"hasChildrenMatchingQuery\": false,\n          \"name\": \"User Views\",\n          \"id\": \"c8dd833e-427b-55a1-9f7d-c4f09ea3524d\",\n          \"objectType\": \"objectTypeEnumSet.containerClass\",\n          \"classification\": \"folder\",\n          \"items\": []\n        },\n        {\n          \"self\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb\",\n          \"parentUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"networkDeviceUrl\": \"https://welchoas/api/v4/networkDevices/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"pointsUrl\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb/points\",\n          \"objectsUrl\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb/objects\",\n          \"alarmsUrl\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb/alarms\",\n          \"auditsUrl\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb/audits\",\n          \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/7fd71bf8-c080-59c3-835f-e5c5f0ffabbb/trendedAttributes\",\n          \"itemReference\": \"welchoas:welchoas/$site.SummaryDefs\",\n          \"hasChildrenMatchingQuery\": false,\n          \"name\": \"Summary Definitions\",\n          \"id\": \"7fd71bf8-c080-59c3-835f-e5c5f0ffabbb\",\n          \"objectType\": \"objectTypeEnumSet.containerClass\",\n          \"classification\": \"folder\",\n          \"items\": []\n        },\n        {\n          \"self\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n          \"parentUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"networkDeviceUrl\": \"https://welchoas/api/v4/networkDevices/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n          \"pointsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/points\",\n          \"objectsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/objects\",\n          \"alarmsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/alarms\",\n          \"auditsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/audits\",\n          \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/trendedAttributes\",\n          \"itemReference\": \"welchoas:welchoas\",\n          \"hasChildrenMatchingQuery\": true,\n          \"name\": \"welchoas\",\n          \"id\": \"8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n          \"objectType\": \"objectTypeEnumSet.oasClass\",\n          \"classification\": \"server\",\n          \"items\": []\n        }\n      ]\n    }\n  ],\n  \"effectivePermissions\": {\n    \"canDelete\": [\n      \"896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n      \"c8dd833e-427b-55a1-9f7d-c4f09ea3524d\",\n      \"7fd71bf8-c080-59c3-835f-e5c5f0ffabbb\"\n    ],\n    \"canView\": [\n      \"896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n      \"c8dd833e-427b-55a1-9f7d-c4f09ea3524d\",\n      \"7fd71bf8-c080-59c3-835f-e5c5f0ffabbb\",\n      \"8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\"\n    ],\n    \"canModify\": [\n      \"896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n      \"c8dd833e-427b-55a1-9f7d-c4f09ea3524d\",\n      \"7fd71bf8-c080-59c3-835f-e5c5f0ffabbb\",\n      \"8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\"\n    ]\n  }\n}\n```\n\n\u003c/details\u003e\n\nAn _absolute url_ looks like `https://{hostname}/api/v4/objects`. Many API\nendpoints return absolute URLs in their response payloads. These are used to\nprovide information about other useful resources on the system. So it's\nconvenient to be able to copy and paste those to make another request.\n\nIn the example above, the `self` property of the last object is\n`https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b`. Let's\nuse that absolute url to read the default view of that object.\n\n```powershell\nInvoke-MetasysMethod https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\n```\n\n\u003cdetails\u003e\u003csummary\u003eClick to See Response\u003c/summary\u003e\n\n```json\n{\n  \"self\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b?includeSchema=false\u0026viewId=viewNameEnumSet.focusView\",\n  \"objectType\": \"objectTypeEnumSet.oasClass\",\n  \"parentUrl\": \"https://welchoas/api/v4/objects/896f7c45-de4b-5a2c-9084-bceb0ec85962\",\n  \"objectsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/objects\",\n  \"networkDeviceUrl\": null,\n  \"pointsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/points\",\n  \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/trendedAttributes\",\n  \"alarmsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/alarms\",\n  \"auditsUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b/audits\",\n  \"item\": {\n    \"id\": \"8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n    \"name\": \"welchoas\",\n    \"description\": null,\n    \"bacnetObjectType\": \"objectTypeEnumSet.bacdeviceClass\",\n    \"objectCategory\": \"objectCategoryEnumSet.generalCategory\",\n    \"modelName\": \"OAS\",\n    \"localTime\": {\n      \"hour\": 16,\n      \"minute\": 58,\n      \"second\": 41,\n      \"hundredth\": 56\n    },\n    \"localDate\": {\n      \"year\": 2021,\n      \"month\": 7,\n      \"dayOfMonth\": 5,\n      \"dayOfWeek\": 1\n    },\n    \"firmwareVersion\": \"12.0.0.6218\",\n    \"itemReference\": \"welchoas:welchoas\",\n    \"version\": {\n      \"major\": 37,\n      \"minor\": 0\n    },\n    \"archiveDate\": {\n      \"year\": 2021,\n      \"month\": 7,\n      \"dayOfMonth\": 5,\n      \"dayOfWeek\": 1\n    },\n    \"maxMessageBuffer\": 994.0,\n    \"maxApduLength\": 1024.0,\n    \"apduSegmentTimeout\": 10000.0,\n    \"apduTimeout\": 10000.0,\n    \"apduRetries\": 4.0,\n    \"internodeCommTimer\": 120.0,\n    \"unboundReferences\": [],\n    \"duplicateReferences\": [],\n    \"fipsComplianceStatus\": \"noOfComplianceStateEnumSet.nonCompliantUnlicensed\",\n    \"almSnoozeTime\": 5.0,\n    \"enableApplicationGenAudit\": false,\n    \"auditEnabledClasLev\": 2.0,\n    \"addAdsrepos\": [],\n    \"adsRepositoriesStatus\": [],\n    \"allowOffSiteRepositoryStorage\": false,\n    \"sampleRate\": 0.0,\n    \"serviceTime\": 66.0,\n    \"numberOfNxesReporting\": 1.0,\n    \"transferBufferFullWorstNxe\": 0.0,\n    \"hostName\": \"\",\n    \"jciExceptionSchedule\": \"weeklySchedPurgeEnumSet.wsAutoDelete31Days\",\n    \"isValidated\": false,\n    \"bacnetObjectCacheExposed\": \"bacnetObjectCacheExposedEnumSet.boceIncludeInList\",\n    \"jciSystemStatus\": \"jciSystemStatusEnumSet.jciOperational\",\n    \"status\": \"objectStatusEnumSet.osNormal\",\n    \"attrChangeCount\": 201.0,\n    \"defaultAttribute\": \"attributeEnumSet.jciSystemStatus\"\n  },\n  \"effectivePermissions\": {\n    \"canDelete\": false,\n    \"canModify\": true\n  },\n  \"views\": [\n    {\n      \"title\": \"Focus\",\n      \"views\": [\n        {\n          \"title\": \"Basic\",\n          \"views\": [\n            {\n              \"title\": \"Object\",\n              \"properties\": [\n                \"name\",\n                \"description\",\n                \"bacnetObjectType\",\n                \"objectCategory\",\n                \"modelName\"\n              ],\n              \"id\": \"viewGroupEnumSet.objectGrp\"\n            },\n            {\n              \"title\": \"Time\",\n              \"properties\": [\"localTime\", \"localDate\"],\n              \"id\": \"viewGroupEnumSet.timeGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.basicGrpType\"\n        },\n        {\n          \"title\": \"Advanced\",\n          \"views\": [\n            {\n              \"title\": \"Engineering Values\",\n              \"properties\": [\n                \"firmwareVersion\",\n                \"itemReference\",\n                \"version\",\n                \"archiveDate\",\n                \"maxMessageBuffer\",\n                \"maxApduLength\",\n                \"apduSegmentTimeout\",\n                \"apduTimeout\",\n                \"apduRetries\",\n                \"internodeCommTimer\",\n                \"unboundReferences\",\n                \"duplicateReferences\",\n                \"fipsComplianceStatus\",\n                \"id\"\n              ],\n              \"id\": \"viewGroupEnumSet.engValuesGrp\"\n            },\n            {\n              \"title\": \"Alarms\",\n              \"properties\": [\"almSnoozeTime\"],\n              \"id\": \"viewGroupEnumSet.alarmsGrp\"\n            },\n            {\n              \"title\": \"Audit Trail\",\n              \"properties\": [\n                \"enableApplicationGenAudit\",\n                \"auditEnabledClasLev\"\n              ],\n              \"id\": \"viewGroupEnumSet.auditTrailGrp\"\n            },\n            {\n              \"title\": \"Repository Storage\",\n              \"properties\": [\n                \"addAdsrepos\",\n                \"adsRepositoriesStatus\",\n                \"allowOffSiteRepositoryStorage\",\n                \"sampleRate\",\n                \"serviceTime\",\n                \"numberOfNxesReporting\",\n                \"transferBufferFullWorstNxe\",\n                \"hostName\"\n              ],\n              \"id\": \"viewGroupEnumSet.repositoryStorageGrp\"\n            },\n            {\n              \"title\": \"Weekly Scheduling\",\n              \"properties\": [\"jciExceptionSchedule\"],\n              \"id\": \"viewGroupEnumSet.weeklySchedGrp\"\n            },\n            {\n              \"title\": \"Validated Environment\",\n              \"properties\": [\"isValidated\"],\n              \"id\": \"viewGroupEnumSet.validatedEnvironmentGrp\"\n            },\n            {\n              \"title\": \"BACnet Routing\",\n              \"properties\": [\"bacnetObjectCacheExposed\"],\n              \"id\": \"viewGroupEnumSet.routingGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.advancedGrpType\"\n        },\n        {\n          \"title\": \"Key\",\n          \"views\": [\n            {\n              \"title\": \"None\",\n              \"properties\": [\n                \"jciSystemStatus\",\n                \"status\",\n                \"attrChangeCount\",\n                \"defaultAttribute\"\n              ],\n              \"id\": \"viewGroupEnumSet.noGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.keyGrpType\"\n        }\n      ],\n      \"id\": \"viewNameEnumSet.focusView\"\n    }\n  ],\n  \"condition\": {}\n}\n```\n\n\u003c/details\u003e\n\nA _relative url_ looks like `/objects`. In other words, it's everything after\n`https://{hostname}/api/v4`.\n\nIn this next example we'll read the `presentValue` of an object. I happen to\nknow the `id` for this object is `ce820989-5617-50bd-90ea-2fd95d1402ba`.\n\n```powershell\nPS \u003e Invoke-MetasysMethod https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/attributes/presentValue\n\n{\n  \"item\": {\n    \"presentValue\": 68.2\n  },\n  \"condition\": {\n    \"presentValue\": {}\n  }\n}\n```\n\nThis time we showed the use of an absolute url. We could have just used\n`/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/attributes/presentValue` instead.\nEither type of url is fine.\n\nAnother good tip is to save identifiers in variables so you don't have to type\nthem multiple times or copy/paste them:\n\n```powershell\n$Id = \"ce820989-5617-50bd-90ea-2fd95d1402ba\"\nInvoke-MetasysMethod https://welchoas/api/v4/objects/$Id/attributes/presentValue\n```\n\nExamples of other urls that support `GET`\n\n- `/alarms` - Get first page of alarms\n- `/audits` - Get first page of audits\n- `/activities` - Get first page of the collection of all activities (the\n  activities collection is a union of the alarms and audits collections)\n- `/objects/$id/objects` - Get the child objects of the specified object where\n  `$id` contains a valid object identifier.\n\n### Writing An Object Attribute (PATCH)\n\nIn this example we'll change the value of an object attribute. This requires us\nto use two new parameters. First we'll use the `Method` parameter to specify we\nare sending a `PATCH` request, and we'll use the `Body` parameter to specify the\ncontent we want to send.\n\nLet's change the `description` attribute of the AV from the previous section.\nLet's first read it to confirm it's currently `null`. Recall that we've saved\nthe identifier in the variable `$Id`.\n\n```powershell\nPS \u003e Invoke-MetasysMethod /objects/$Id/attributes/description\n\n{\n  \"item\": {\n    \"description\": null\n    },\n  \"condition\": {}\n}\n```\n\nWe'll change the value to be `Zone 3 Temperature Set Point`. We are going to\nsend this body to do that:\n\n```json\n{\n  \"item\": {\n    \"description\": \"Zone 3 Temperature Set Point\"\n  }\n}\n```\n\nIt can be a little tricky dealing with large JSON strings. There are many ways\nto construct them. See [Tips for Working With PowerShell](docs/tips.md) for\nexamples of working with JSON strings.\n\nWhen the JSON string is relatively short like in this example you can just type\nit all on one line:\n\n```powershell\nInvoke-MetasysMethod -Method Patch /objects/$Id  -Body \"{ 'item': { 'description': 'Zone 3 Temperature Set Point' } }\"\n```\n\nWe'll read it back to ensure it changed:\n\n```powershell\nPS \u003e Invoke-MetasysMethod /objects/$Id/attributes/description\n{\n  \"item\": {\n    \"description\": \"Zone 3 Temperature Set Point\"\n  },\n  \"condition\": {\n    \"description\": {}\n  }\n}\n```\n\n### Using an Alias\n\nMany of the built-in PowerShell commands have long names just like\n`Invoke-WebRequest`. Many of those also have aliases that are much shorter (eg.\n`iwr` for `Invoke-WebRequest`). The command `Invoke-MetasysMethod` also has an\nalias, `imm`, which you can use instead of the full name. For the remainder of\nthis README we'll use `imm` instead of `Invoke-MetasysMethod`. The alias for\n`Connect-MetasysAccount` is `cma`.\n\n### Sending a Command to an Object (PUT)\n\nIn this example we'll send an `adjustCommand` command to an AV.\n\nWe can discover that the object supports `adjustCommand` by requesting the list\nof commands:\n\n```powershell\nimm /objects/$Id/commands\n```\n\n\u003cdetails\u003e\u003csummary\u003e Click to see response\u003c/summary\u003e\n\n```json\n{\n  \"self\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands\",\n  \"items\": [\n    {\n      \"id\": \"commandIdEnumSet.adjustCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.adjustCommand\",\n      \"title\": \"Adjust\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"priority\": {\n            \"oneOf\": [\n              {\n                \"$ref\": \"#writePriorityEnumSet\"\n              },\n              {\n                \"type\": \"null\"\n              }\n            ]\n          },\n          \"parameters\": {\n            \"type\": \"array\",\n            \"metasysType\": \"list\",\n            \"items\": [\n              {\n                \"id\": \"commandParmsEnumSet.valueCmdparm\",\n                \"title\": \"Value\",\n                \"displayPrecisionSource\": \"displayPrecision\",\n                \"maxPresValueSource\": \"maxPresValue\",\n                \"minPresValueSource\": \"minPresValue\",\n                \"unitsSource\": \"units\",\n                \"metasysType\": \"float\",\n                \"type\": \"number\",\n                \"minimum\": -1.69999997607218e38,\n                \"maximum\": 1.69999997607218e38,\n                \"displayPrecision\": {\n                  \"id\": \"displayPrecisionEnumSet.displayPrecisionPt1\",\n                  \"displayMultipleOf\": 0.1\n                },\n                \"default\": 0\n              }\n            ],\n            \"minItems\": 1,\n            \"maxItems\": 1\n          },\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": {\n          \"writePriorityEnumSet\": {\n            \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n            \"title\": \"Write Priority\",\n            \"$id\": \"#writePriorityEnumSet\",\n            \"allOf\": [\n              {\n                \"oneOf\": [\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityNone\",\n                    \"title\": \"0 (No Priority)\",\n                    \"memberId\": 0\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityManualEmergency\",\n                    \"title\": \"1 (Manual Life Safety)\",\n                    \"memberId\": 1\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityFireApplications\",\n                    \"title\": \"2 (Auto Life Safety)\",\n                    \"memberId\": 2\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority3\",\n                    \"title\": \"3 (Application)\",\n                    \"memberId\": 3\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority4\",\n                    \"title\": \"4 (Application)\",\n                    \"memberId\": 4\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityCriticalEquipment\",\n                    \"title\": \"5 (Critical Equipment)\",\n                    \"memberId\": 5\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityMinimumOnOff\",\n                    \"title\": \"6 (Minimum On Off)\",\n                    \"memberId\": 6\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityHeavyEquipDelay\",\n                    \"title\": \"7 (Heavy Equip Delay)\",\n                    \"memberId\": 7\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityOperatorOverride\",\n                    \"title\": \"8 (Operator Override)\",\n                    \"memberId\": 8\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority9\",\n                    \"title\": \"9 (Application)\",\n                    \"memberId\": 9\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority10\",\n                    \"title\": \"10 (Application)\",\n                    \"memberId\": 10\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityDemandLimiting\",\n                    \"title\": \"11 (Demand Limiting)\",\n                    \"memberId\": 11\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority12\",\n                    \"title\": \"12 (Application)\",\n                    \"memberId\": 12\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityLoadRolling\",\n                    \"title\": \"13 (Load Rolling)\",\n                    \"memberId\": 13\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority14\",\n                    \"title\": \"14 (Application)\",\n                    \"memberId\": 14\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.prioritySchedulingOst\",\n                    \"title\": \"15 (Scheduling)\",\n                    \"memberId\": 15\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityDefault\",\n                    \"title\": \"16 (Default)\",\n                    \"memberId\": 16\n                  }\n                ]\n              },\n              {\n                \"$ref\": \"https://welchoas/api/v3/schemas/enums/writePriorityEnumSet\"\n              }\n            ],\n            \"setId\": 1\n          }\n        }\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.overrideCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.overrideCommand\",\n      \"title\": \"Operator Override\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"parameters\": {\n            \"type\": \"array\",\n            \"metasysType\": \"list\",\n            \"items\": [\n              {\n                \"id\": \"commandParmsEnumSet.valueCmdparm\",\n                \"title\": \"Value\",\n                \"displayPrecisionSource\": \"displayPrecision\",\n                \"maxPresValueSource\": \"maxPresValue\",\n                \"minPresValueSource\": \"minPresValue\",\n                \"unitsSource\": \"units\",\n                \"metasysType\": \"float\",\n                \"type\": \"number\",\n                \"minimum\": -1.69999997607218e38,\n                \"maximum\": 1.69999997607218e38,\n                \"displayPrecision\": {\n                  \"id\": \"displayPrecisionEnumSet.displayPrecisionPt1\",\n                  \"displayMultipleOf\": 0.1\n                },\n                \"default\": 0\n              }\n            ],\n            \"minItems\": 1,\n            \"maxItems\": 1\n          },\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": null\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.temporaryOverrideCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.temporaryOverrideCommand\",\n      \"title\": \"Temporary Override\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"parameters\": {\n            \"type\": \"array\",\n            \"metasysType\": \"list\",\n            \"items\": [\n              {\n                \"id\": \"commandParmsEnumSet.valueCmdparm\",\n                \"title\": \"Value\",\n                \"displayPrecisionSource\": \"displayPrecision\",\n                \"maxPresValueSource\": \"maxPresValue\",\n                \"minPresValueSource\": \"minPresValue\",\n                \"unitsSource\": \"units\",\n                \"metasysType\": \"float\",\n                \"type\": \"number\",\n                \"minimum\": -1.69999997607218e38,\n                \"maximum\": 1.69999997607218e38,\n                \"displayPrecision\": {\n                  \"id\": \"displayPrecisionEnumSet.displayPrecisionPt1\",\n                  \"displayMultipleOf\": 0.1\n                },\n                \"default\": 0\n              },\n              {\n                \"id\": \"commandParmsEnumSet.hoursCmdparm\",\n                \"title\": \"Hours\",\n                \"metasysType\": \"ulong\",\n                \"type\": \"integer\",\n                \"minimum\": 0,\n                \"maximum\": 100,\n                \"default\": 0\n              },\n              {\n                \"id\": \"commandParmsEnumSet.minutesCmdparm\",\n                \"title\": \"Minutes\",\n                \"metasysType\": \"ulong\",\n                \"type\": \"integer\",\n                \"minimum\": 0,\n                \"maximum\": 59,\n                \"default\": 0\n              }\n            ],\n            \"minItems\": 3,\n            \"maxItems\": 3\n          },\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": null\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.overrideReleaseCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.overrideReleaseCommand\",\n      \"title\": \"Release Operator Override\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": null\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.releaseCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.releaseCommand\",\n      \"title\": \"Release\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"parameters\": {\n            \"type\": \"array\",\n            \"metasysType\": \"list\",\n            \"items\": [\n              {\n                \"id\": \"commandParmsEnumSet.attributeCmdparm\",\n                \"title\": \"Attribute\",\n                \"type\": \"string\",\n                \"metasysType\": \"enum\",\n                \"oneOf\": [\n                  {\n                    \"$ref\": \"#attributeEnumSet\"\n                  }\n                ],\n                \"default\": \"attributeEnumSet.presentValue\"\n              },\n              {\n                \"id\": \"commandParmsEnumSet.priorityCmdparm\",\n                \"title\": \"Priority\",\n                \"numberOfStates\": 17,\n                \"type\": \"string\",\n                \"metasysType\": \"enum\",\n                \"oneOf\": [\n                  {\n                    \"$ref\": \"#writePriorityEnumSet_endAt_17\"\n                  }\n                ],\n                \"default\": \"writePriorityEnumSet.priorityDefault\"\n              }\n            ],\n            \"minItems\": 2,\n            \"maxItems\": 2\n          },\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": {\n          \"attributeEnumSet\": {\n            \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n            \"title\": \"Attribute\",\n            \"$id\": \"#attributeEnumSet\",\n            \"allOf\": [\n              {\n                \"oneOf\": [\n                  {\n                    \"const\": \"attributeEnumSet.presentValue\",\n                    \"title\": \"Present Value\",\n                    \"memberId\": 85\n                  }\n                ]\n              },\n              {\n                \"$ref\": \"https://welchoas/api/v3/schemas/enums/attributeEnumSet\"\n              }\n            ],\n            \"setId\": 509\n          },\n          \"writePriorityEnumSet_endAt_17\": {\n            \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n            \"title\": \"Write Priority\",\n            \"$id\": \"#writePriorityEnumSet_endAt_17\",\n            \"allOf\": [\n              {\n                \"oneOf\": [\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityNone\",\n                    \"title\": \"0 (No Priority)\",\n                    \"memberId\": 0\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityManualEmergency\",\n                    \"title\": \"1 (Manual Life Safety)\",\n                    \"memberId\": 1\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityFireApplications\",\n                    \"title\": \"2 (Auto Life Safety)\",\n                    \"memberId\": 2\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority3\",\n                    \"title\": \"3 (Application)\",\n                    \"memberId\": 3\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority4\",\n                    \"title\": \"4 (Application)\",\n                    \"memberId\": 4\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityCriticalEquipment\",\n                    \"title\": \"5 (Critical Equipment)\",\n                    \"memberId\": 5\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityMinimumOnOff\",\n                    \"title\": \"6 (Minimum On Off)\",\n                    \"memberId\": 6\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityHeavyEquipDelay\",\n                    \"title\": \"7 (Heavy Equip Delay)\",\n                    \"memberId\": 7\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityOperatorOverride\",\n                    \"title\": \"8 (Operator Override)\",\n                    \"memberId\": 8\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority9\",\n                    \"title\": \"9 (Application)\",\n                    \"memberId\": 9\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority10\",\n                    \"title\": \"10 (Application)\",\n                    \"memberId\": 10\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityDemandLimiting\",\n                    \"title\": \"11 (Demand Limiting)\",\n                    \"memberId\": 11\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority12\",\n                    \"title\": \"12 (Application)\",\n                    \"memberId\": 12\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityLoadRolling\",\n                    \"title\": \"13 (Load Rolling)\",\n                    \"memberId\": 13\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priority14\",\n                    \"title\": \"14 (Application)\",\n                    \"memberId\": 14\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.prioritySchedulingOst\",\n                    \"title\": \"15 (Scheduling)\",\n                    \"memberId\": 15\n                  },\n                  {\n                    \"const\": \"writePriorityEnumSet.priorityDefault\",\n                    \"title\": \"16 (Default)\",\n                    \"memberId\": 16\n                  }\n                ]\n              },\n              {\n                \"$ref\": \"https://welchoas/api/v3/schemas/enums/writePriorityEnumSet\"\n              }\n            ],\n            \"setId\": 1\n          }\n        }\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.releaseAllCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.releaseAllCommand\",\n      \"title\": \"Release All\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"parameters\": {\n            \"type\": \"array\",\n            \"metasysType\": \"list\",\n            \"items\": [\n              {\n                \"id\": \"commandParmsEnumSet.attributeCmdparm\",\n                \"title\": \"Attribute\",\n                \"type\": \"string\",\n                \"metasysType\": \"enum\",\n                \"oneOf\": [\n                  {\n                    \"$ref\": \"#attributeEnumSet\"\n                  }\n                ],\n                \"default\": \"attributeEnumSet.presentValue\"\n              }\n            ],\n            \"minItems\": 1,\n            \"maxItems\": 1\n          },\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": {\n          \"attributeEnumSet\": {\n            \"$schema\": \"http://json-schema.org/draft-07/schema#\",\n            \"title\": \"Attribute\",\n            \"$id\": \"#attributeEnumSet\",\n            \"allOf\": [\n              {\n                \"oneOf\": [\n                  {\n                    \"const\": \"attributeEnumSet.presentValue\",\n                    \"title\": \"Present Value\",\n                    \"memberId\": 85\n                  }\n                ]\n              },\n              {\n                \"$ref\": \"https://welchoas/api/v3/schemas/enums/attributeEnumSet\"\n              }\n            ],\n            \"setId\": 509\n          }\n        }\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.enableAlarmsCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.enableAlarmsCommand\",\n      \"title\": \"Enable Alarms\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": null\n      }\n    },\n    {\n      \"id\": \"commandIdEnumSet.disableAlarmsCommand\",\n      \"invokeUrl\": \"https://welchoas/api/v4/objects/ce820989-5617-50bd-90ea-2fd95d1402ba/commands/commandIdEnumSet.disableAlarmsCommand\",\n      \"title\": \"Disable Alarms\",\n      \"commandBodySchema\": {\n        \"type\": \"object\",\n        \"metasysType\": \"struct\",\n        \"properties\": {\n          \"annotation\": {\n            \"title\": \"Annotation\",\n            \"type\": \"string\",\n            \"metasysType\": \"string\",\n            \"minLength\": 1,\n            \"maxLength\": 255\n          },\n          \"required\": [],\n          \"additionalProperties\": false\n        },\n        \"definitions\": null\n      }\n    }\n  ],\n  \"effectivePermissions\": {\n    \"canInvoke\": [\n      \"commandIdEnumSet.adjustCommand\",\n      \"commandIdEnumSet.overrideCommand\",\n      \"commandIdEnumSet.temporaryOverrideCommand\",\n      \"commandIdEnumSet.overrideReleaseCommand\",\n      \"commandIdEnumSet.releaseCommand\",\n      \"commandIdEnumSet.releaseAllCommand\",\n      \"commandIdEnumSet.enableAlarmsCommand\",\n      \"commandIdEnumSet.disableAlarmsCommand\"\n    ]\n  }\n}\n```\n\n\u003c/details\u003e\n\nThe details of the response are outside of the scope of this tutorial, but we do\nsee the `adjustCommand` in the response and we see that it's body is expected to\nbe an object with a `parameters` property. The definition of `parameters` tells\nus it needs to be an array with one numeric value. So we can do the following.\n\n```powershell\nPS \u003e imm /objects/$Id/commands/adjustCommand -Method Put -Body \"{ 'parameters': [ 72.5 ] }\"\n\n\"Success\"\n```\n\nWe could also add an annotation to the command:\n\n```powershell\n$json = '{ \"parameters\": [72.5], \"annotation\": \"Adjust Set Point for the afternoon\" }'\nimm /objects/$Id/commands/adjustCommand -Method Put -Body $json\n```\n\n### Creating an Object (POST)\n\nFor this example we'll create a new AV. A typical payload to create an AV might\nlook something like this:\n\n```json\n{\n  \"localUniqueIdentifier\": \"Set Point\",\n  \"parentId\": \"8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n  \"objectType\": \"objectTypeEnumSet.avClass\",\n  \"item\": {\n    \"name\": \"Set Point\",\n    \"objectCategory\": \"objectCategoryEnumSet.hvacCategory\",\n    \"minPresValue\": -50,\n    \"maxPresValue\": 150,\n    \"units\": \"unitEnumSet.degF\"\n  }\n}\n```\n\nWe'll assume that JSON is stored in a file call `new-av.json` which is in the\nsame directory that we are running our commands from. (We'll use the\n`Get-Content` command to read that file and provide it as the body. Be sure to\nuse the `Raw` switch so that `Get-Content` returns the whole file as one string,\nrather than an array of strings -- one string per line).\n\n```powershell\nimm /objects -Method Post -Body (Get-Content -Path new-av.json -Raw)\n```\n\nNotice that currently the creation of a new object doesn't return anything. So\nhow do we know if it was successful? There are some helper functions that allow\nus to inspect the last response. I'll demonstrate three of them\n`Show-LastMetasysStatus`, `Show-LastMetasysHeaders` and\n`Show-LastMetasysFullResponse`\n\n```powershell\n# Show the status of last call\nPS \u003e Show-LastMetasysStatus\n200 (OK)\n\n# Show the headers of the last call\n# Notice the Location header tells us the URL of the new object\nPS \u003e Show-LastMetasysHeaders\nContent-Length: 0\nStrict-Transport-Security: max-age=31536000\nDate: Mon, 05 Jul 2021 23:07:21 GMT\nLocation: https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84\nX-Content-Type-Options: nosniff\nPragma: no-cache,no-cache\nX-XSS-Protection: 1; mode=block\nExpires: -1\nCache-Control: private\nSet-Cookie: Secure; HttpOnly\n\n# Show the entire last response: status, headers, body\nPS \u003e Show-LastMetasysFullResponse\n200 (OK)\nContent-Length: 0\nStrict-Transport-Security: max-age=31536000\nDate: Mon, 05 Jul 2021 23:07:21 GMT\nLocation: https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84\nX-Content-Type-Options: nosniff\nPragma: no-cache,no-cache\nX-XSS-Protection: 1; mode=block\nExpires: -1\nCache-Control: private\nSet-Cookie: Secure; HttpOnly\n```\n\n\u003e [!Note]\\\n\u003e The status of `200` tells us everything was good and the `Location` header from\n\u003e above gives the url we can use to read the object back.\n\n```powershell\nimm https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84\n```\n\n\u003cdetails\u003e\u003csummary\u003eClick to see response\u003c/summary\u003e\n\n```json\n{\n  \"self\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84?includeSchema=false\u0026viewId=viewNameEnumSet.focusView\",\n  \"objectType\": \"objectTypeEnumSet.avClass\",\n  \"parentUrl\": \"https://welchoas/api/v4/objects/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n  \"objectsUrl\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84/objects\",\n  \"networkDeviceUrl\": \"https://welchoas/api/v4/networkDevices/8f2c6bb1-6bfd-5643-b581-299c1fec6b1b\",\n  \"pointsUrl\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84/points\",\n  \"trendedAttributesUrl\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84/trendedAttributes\",\n  \"alarmsUrl\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84/alarms\",\n  \"auditsUrl\": \"https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84/audits\",\n  \"item\": {\n    \"id\": \"3fdb754b-4f6e-592e-9c1e-8b72ad51cb84\",\n    \"name\": \"Set Point\",\n    \"description\": null,\n    \"bacnetObjectType\": \"objectTypeEnumSet.bacAvClass\",\n    \"objectCategory\": \"objectCategoryEnumSet.hvacCategory\",\n    \"outOfService\": false,\n    \"reliability\": \"reliabilityEnumSet.reliable\",\n    \"currentCommandPriority\": null,\n    \"alarmState\": \"objectStatusEnumSet.osNormal\",\n    \"overrideExpirationTime\": {\n      \"date\": null,\n      \"time\": null\n    },\n    \"presentValueWritable\": \"objectModeEnumSet.presentValueWritableWithPriority\",\n    \"itemReference\": \"welchoas:welchoas/Set Point\",\n    \"version\": {\n      \"major\": 1,\n      \"minor\": 0\n    },\n    \"prioritySupported\": true,\n    \"minPresValue\": -50.0,\n    \"maxPresValue\": 150.0,\n    \"units\": \"unitEnumSet.degF\",\n    \"displayPrecision\": \"displayPrecisionEnumSet.displayPrecisionPt1\",\n    \"covIncrement\": 0.01,\n    \"connectedToInternalApplication\": \"noYesEnumSet.fanNo\",\n    \"presentValue\": 0.0,\n    \"status\": \"objectStatusEnumSet.osNormal\",\n    \"attrChangeCount\": 50.0,\n    \"defaultAttribute\": \"attributeEnumSet.presentValue\"\n  },\n  \"effectivePermissions\": {\n    \"canDelete\": true,\n    \"canModify\": true\n  },\n  \"views\": [\n    {\n      \"title\": \"Focus\",\n      \"views\": [\n        {\n          \"title\": \"Basic\",\n          \"views\": [\n            {\n              \"title\": \"Object\",\n              \"properties\": [\n                \"name\",\n                \"description\",\n                \"bacnetObjectType\",\n                \"objectCategory\"\n              ],\n              \"id\": \"viewGroupEnumSet.objectGrp\"\n            },\n            {\n              \"title\": \"Status\",\n              \"properties\": [\n                \"outOfService\",\n                \"reliability\",\n                \"currentCommandPriority\",\n                \"alarmState\",\n                \"overrideExpirationTime\",\n                \"presentValueWritable\"\n              ],\n              \"id\": \"viewGroupEnumSet.statusGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.basicGrpType\"\n        },\n        {\n          \"title\": \"Advanced\",\n          \"views\": [\n            {\n              \"title\": \"Engineering Values\",\n              \"properties\": [\n                \"itemReference\",\n                \"version\",\n                \"prioritySupported\",\n                \"minPresValue\",\n                \"maxPresValue\",\n                \"id\"\n              ],\n              \"id\": \"viewGroupEnumSet.engValuesGrp\"\n            },\n            {\n              \"title\": \"Display\",\n              \"properties\": [\"units\", \"displayPrecision\", \"covIncrement\"],\n              \"id\": \"viewGroupEnumSet.displayGrp\"\n            },\n            {\n              \"title\": \"Internal Logic Interface\",\n              \"properties\": [\"connectedToInternalApplication\"],\n              \"id\": \"viewGroupEnumSet.internalLogicIfGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.advancedGrpType\"\n        },\n        {\n          \"title\": \"Key\",\n          \"views\": [\n            {\n              \"title\": \"None\",\n              \"properties\": [\n                \"presentValue\",\n                \"status\",\n                \"attrChangeCount\",\n                \"defaultAttribute\"\n              ],\n              \"id\": \"viewGroupEnumSet.noGrp\"\n            }\n          ],\n          \"id\": \"groupTypeEnumSet.keyGrpType\"\n        }\n      ],\n      \"id\": \"viewNameEnumSet.focusView\"\n    }\n  ],\n  \"condition\": {}\n}\n```\n\n\u003c/details\u003e\n\nRather than rely on the `Show-` methods, we can use the\n`-IncludeResponseHeaders` switch at the time we invoke the method and all of the\nresponse headers will be shown when the request finishes.\n\n```powershell\nPS \u003e imm /objects -Method Post -Body (Get-Content -Path new-av.json -Raw) -IncludeResponseHeaders\n\n200 (OK)\nLocation: https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84\nExpires: -1\nCache-Control: private\nStrict-Transport-Security: max-age=31536000\nDate: Fri, 21 Jan 2022 20:03:56 GMT\nPragma: no-cache,no-cache\nContent-Length: 0\nX-XSS-Protection: 1; mode=block\nSet-Cookie: Secure; HttpOnly\nX-Content-Type-Options: nosniff\n```\n\n### Delete an Object (DELETE)\n\nLet's delete the previous object\n\n```powershell\n# There is no response body to this payload, use -IncludeResponseHeaders to see the results\nPS \u003e imm -Method Delete https://welchoas/api/v4/objects/3fdb754b-4f6e-592e-9c1e-8b72ad51cb84 -IncludeResponseHeaders\n\n204 (NoContent)\nX-XSS-Protection: 1; mode=block\nDate: Mon, 05 Jul 2021 23:26:28 GMT\nPragma: no-cache,no-cache\nStrict-Transport-Security: max-age=31536000\nExpires: -1\nCache-Control: no-store, must-revalidate, no-cache, max-age=0, s-maxage=0, pre-check=0, post-check=0\nX-Content-Type-Options: nosniff\nSet-Cookie: Secure; HttpOnly\n```\n\n## Configuration\n\nThe Metasys Rest Client supports a limited amount of configuration. To configure\nthe app create a `.metasysrestclient` file in your home directory.\n\nThe configuration allows you to specify the default values to use when invoking\n`Connect-MetasysAccount` for a specific host.\n\nThe following properties are supported:\n\n- `hosts` - An array of entries that describe a host you want to connect to.\n  Each entry must contain an `alias` and a `hostname`. Optionally, you can\n  specify other properties for a host as well. You can have multiple entries for\n  the same `hostname` as long as they have different aliases.\n\nA host entry has the following properties:\n\n- `hostname` **required** `string` - The resolvable hostname or ip address of a\n  host.\n- `alias` **required** `string` - An alias to assign to that host. This alias\n  can then be used as the `Alias` parameter in an invocation of\n  `Connect-MetasysAccount`\n- `username` _optional_ `string` - The user account to use to log into\n  `hostname`. If specified, this will be used as the `UserName` parameter in an\n  invocation of `Connect-MetasysAccount`.\n- `version` _optional_ `string` - The version of the API to use for this host.\n- `skip-certificate-check` _optional_ `switch` - Set this to any value to\n  specify that you want certificate checking skipped. Typically you would use\n  `true` but any value (including `false` and `null`) means the same thing. You\n  must delete this key to restore certificate checking. (The same warnings apply\n  as to those given for `-SkipCertificateCheck` above.)\n\n### Example Configuration\n\nAssume you had the following content in `$HOME/.metasysrestclient`\n\n```jsonc\n{\n  \"hosts\": [\n    {\n      \"hostname\": \"myhost.domain\",\n      \"alias\": \"myhost\"\n    },\n    {\n      \"hostname\": \"host2.domain\",\n      \"alias\": \"host2\"\n    },\n    {\n      \"hostname\": \"myhost.domain\",\n      \"alias\": \"myhost2\",\n      \"username\": \"john_smith\",\n      \"version\": \"4\",\n      \"skip-certificate-check\": true\n    }\n  ]\n}\n```\n\nThen the following two commands are equivalent as they both would attempt to\nconnect to `myhost.domain`\n\n```bash\ncma myhost\ncma -MetasysHost myhost.domain\n```\n\n\u003e **Note** The `Alias` parameter is positional so you don't need to explicitly\n\u003e state it. (Recall that `cma` is the alias for `Connect-MetasysAccount`.)\n\nLikewise the following two commands are equivalent. Both attempt to login to\n`myhost.domain` with a `UserName` of `john_smith`, using version `4` and\nskipping any certificate checks.\n\n```bash\ncma -MetasysHost myhost.domain -UserName john_smith -Version 4 -SkipCertificateCheck\ncma myhost2\n```\n\n\u003e [!Tip]\\\n\u003e If you supply a value for `-UserName` it will override any `username` value in\n\u003e `.metasysrestclient`. Likewise, if you supply a value for `-Version` it will override\n\u003e any `version` value in `.metasysrestclient`.\n\nFor example\n\n```bash\ncma myhost2 -Version 3 -UserName bob\n```\n\nWill use a version `3` and user `bob` instead of the values in\n`.metasysrestclient`.\n\n## Troubleshooting\n\n### Invalid Certificates\n\nThis command will fail to execute if the server you are executing against\ndoesn't have a valid certificate. A parameter is provided,\n`SkipCertificateCheck`, which causes all validation checks to be skipped. This\nincludes all validations such as expiration, revocation, trusted root authority,\netc.\n\n\u003e [!Caution]\\\n\u003e Using this parameter is not secure and is not recommended. This switch is intended\n\u003e to be used against known hosts using a self-signed certificate for testing purposes.\n\u003e _Use at your own risk_.\n\n## Testing\n\nThe tests are alongside the modules in `/src/MetasysRestClient`. To run the\ntests change into that directory and invoke pester:\n\n```powershell\nPS \u003e cd src/MetasysRestClient\nPS \u003e Invoke-Pester\n```\n\nOr simply use the script `runtests.ps1` in the root\n\n```powershell\nPS \u003e ./runtests.ps1\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjci-metasys%2Fpowershell-metasysrestclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjci-metasys%2Fpowershell-metasysrestclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjci-metasys%2Fpowershell-metasysrestclient/lists"}