{"id":23478365,"url":"https://github.com/opennms/wsman","last_synced_at":"2025-04-14T21:29:35.075Z","repository":{"id":57739695,"uuid":"48124422","full_name":"OpenNMS/wsman","owner":"OpenNMS","description":"A WS-Man client for Java","archived":false,"fork":false,"pushed_at":"2024-12-09T16:46:27.000Z","size":324,"stargazers_count":12,"open_issues_count":8,"forks_count":3,"subscribers_count":28,"default_branch":"master","last_synced_at":"2024-12-09T17:44:59.007Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenNMS.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","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":"2015-12-16T17:19:22.000Z","updated_at":"2023-06-13T10:03:07.000Z","dependencies_parsed_at":"2024-12-09T17:44:10.589Z","dependency_job_id":null,"html_url":"https://github.com/OpenNMS/wsman","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMS%2Fwsman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMS%2Fwsman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMS%2Fwsman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenNMS%2Fwsman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenNMS","download_url":"https://codeload.github.com/OpenNMS/wsman/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231143164,"owners_count":18334356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-12-24T19:19:03.696Z","updated_at":"2024-12-24T19:19:07.681Z","avatar_url":"https://github.com/OpenNMS.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WS-Man Client [![CircleCI](https://circleci.com/gh/OpenNMS/wsman.svg?style=svg)](https://circleci.com/gh/OpenNMS/wsman)\n\nA pure Java WS-Man client implemented using JAX-WS \u0026 CXF with support for:\n* Enumerate and Pull Operations (DSP8037)\n* Get Operations (DSP8035)\n* Identify Operation (DSP0226)\n* Basic, NTLM and SPNEGO Authentication\n* OSGi Compatible\n\n## Java Example\n\nArtifacts are available in Maven Central. Add it to your Maven project using:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003eorg.opennms.core.wsman\u003c/groupId\u003e\n  \u003cartifactId\u003eorg.opennms.core.wsman.cxf\u003c/artifactId\u003e\n  \u003cversion\u003e1.2.3\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nAnd start enumerating resources:\n\n```java\npackage org.opennms.core.wsman.example;\n\nimport java.net.MalformedURLException;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.opennms.core.wsman.WSManClient;\nimport org.opennms.core.wsman.WSManConstants;\nimport org.opennms.core.wsman.WSManEndpoint;\nimport org.opennms.core.wsman.WSManVersion;\nimport org.opennms.core.wsman.cxf.CXFWSManClientFactory;\nimport org.w3c.dom.Node;\n\npublic class WSManClientExample {\n\n    public static void main(String[] args) throws MalformedURLException {\n        WSManEndpoint endpoint = new WSManEndpoint.Builder(\"https://127.0.0.1/wsman\")\n                .withServerVersion(WSManVersion.WSMAN_1_0)\n                .withStrictSSL(false)\n                .build();\n        WSManClient client = new CXFWSManClientFactory().getClient(endpoint);\n\n        List\u003cNode\u003e nodes = new ArrayList\u003c\u003e();\n        client.enumerateAndPullUsingFilter(\n                WSManConstants.CIM_ALL_AVAILABLE_CLASSES,\n                WSManConstants.XML_NS_WQL_DIALECT,\n                \"select DeviceDescription,PrimaryStatus,TotalOutputPower,InputVoltage,FirmwareVersion,RedundancyStatus from DCIM_PowerSupplyView where DetailedState != 'Absent' and PrimaryStatus != 0\",\n                nodes,\n                true);\n    }\n}\n```\n\n## Compiling From Source\n\nRequires Java 8 and Maven 3 (tested with 3.3.3)\n\n```sh\nmvn clean package\n```\n\n## Using the CLI\n\nOnce you've successfully compiled the project, you'll want to locate the .jar artifact provided by the `cli` module:\n\n```sh\nexport WSMAN_CLI_JAR=cli/target/org.opennms.core.wsman.cli-1.0-SNAPSHOT.jar\n```\n\n### Examples\n\n#### Enumeration\n\nRetrieving the computer system details from an iDrac 6 card\n\n```sh\njava -jar $WSMAN_CLI_JAR -w WSMAN_1_0 -r https://idrac/wsman -u root -p calvin -resourceUri http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_ComputerSystem\n```\n\nRetrieving all of the service details from a Windows 2008 Server:\n\n```sh\njava -jar $WSMAN_CLI_JAR -w WSMAN_1_0 -r http://win2k8:5985 -u Administrator -p PASsW0rdz -resourceUri http://schemas.microsoft.com/wbem/wsman/1/wmi/root/cimv2/Win32_Service\n```\n\n#### Enumeration with WQL filter\n\nRetrieving details from the active power supply on an iDrac 6 card\n\n```sh\njava -jar $WSMAN_CLI_JAR -w WSMAN_1_0 -r https://idrac/wsman -u root -p calvin \"select DeviceDescription,PrimaryStatus,TotalOutputPower,InputVoltage,Range1MaxInputPower,FirmwareVersion,RedundancyStatus from DCIM_PowerSupplyView where DetailedState != 'Absent' and PrimaryStatus != 0\"\n```\n\n#### Get with selectors\n\n```sh\njava -jar $WSMAN_CLI_JAR -w WSMAN_1_0 -r https://idrac/wsman -u root -p calvin -o GET -resourceUri http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_ComputerSystem -s CreationClassName=DCIM_ComputerSystem -s Name=srv:system\n```\n\n#### Debugging:\n\nOutput the WS-Man requests and responses by setting the `-vvv` flag.\n\n```sh\njava -jar $WSMAN_CLI_JAR -w WSMAN_1_0 -r https://idrac/wsman -u root -p calvin -resourceUri http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_PowerSupplyView -v TRACE -vvv\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennms%2Fwsman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopennms%2Fwsman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopennms%2Fwsman/lists"}