{"id":23383755,"url":"https://github.com/mdwheele/bluecat","last_synced_at":"2025-04-08T09:57:53.834Z","repository":{"id":62554403,"uuid":"89602894","full_name":"mdwheele/bluecat","owner":"mdwheele","description":null,"archived":false,"fork":false,"pushed_at":"2017-04-27T15:13:55.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T07:02:22.864Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdwheele.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-27T13:51:32.000Z","updated_at":"2019-09-16T12:17:14.000Z","dependencies_parsed_at":"2022-11-03T05:15:27.478Z","dependency_job_id":null,"html_url":"https://github.com/mdwheele/bluecat","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fbluecat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fbluecat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fbluecat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdwheele%2Fbluecat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdwheele","download_url":"https://codeload.github.com/mdwheele/bluecat/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247819948,"owners_count":21001394,"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-21T22:29:46.069Z","updated_at":"2025-04-08T09:57:53.810Z","avatar_url":"https://github.com/mdwheele.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bluecat\n\nThis gem wraps certain operations with the Bluecat Address Management API via `savon`. I use this specifically to integrate with [Foreman](https://theforeman.org) so there is a lot that this gem cannot do, yet. That said, I am open to pull requests to add more features. \n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'bluecat'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install bluecat\n\n## Usage\n\n```ruby\nrequire 'bluecat'\nrequire 'pp'\n\nclient = Bluecat::Client.new(wsdl: 'https://hostname/Services/API?wsdl')\nclient.login('api-username', 'api-password')\n\n# This is the object ID of where to start\n# your search.\ncontainer_id = 1\n\npp client.ip4_networks(container_id).to_a\n\nclient.logout\n```\n\nIt is a \"best practice\" (according to Bluecat's documentation) to logout at the end of a session. When I use this in other projects, I might expose it like so:\n\n```ruby\nclass SomeUseCase\n  # All access to API happens through this method\n  def bluecat\n    username = HammerCLI::Settings.get(:bluecat, :username)\n    password = HammerCLI::Settings.get(:bluecat, :password)\n\n    client = Bluecat::Client.new(wsdl: HammerCLI::Settings.get(:bluecat, :wsdl))\n    client.login(username, password)\n\n    yield client\n\n    client.logout\n  end\n  \n  def execute\n    bluecat do |client|\n      # Do things with the client\n      client.ip4_networks(@container_id).take(10)\n    end \n  end\nend\n```\n\nIn this way, the client will log in and out for every operation. This may not be best for your use-case.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/mdwheele/bluecat.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwheele%2Fbluecat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdwheele%2Fbluecat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdwheele%2Fbluecat/lists"}