{"id":24350920,"url":"https://github.com/mattumotu/jenkinsnetclient","last_synced_at":"2026-03-03T09:31:29.873Z","repository":{"id":56146954,"uuid":"109127254","full_name":"mattumotu/jenkinsnetclient","owner":"mattumotu","description":"a light weight, object-oriented .Net SDK for interacting with Jenkins","archived":false,"fork":false,"pushed_at":"2020-11-24T09:55:28.000Z","size":104,"stargazers_count":1,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-19T16:43:44.248Z","etag":null,"topics":["csharp","dotnet","jenkins"],"latest_commit_sha":null,"homepage":"","language":"C#","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/mattumotu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-01T12:14:06.000Z","updated_at":"2024-10-15T12:16:02.000Z","dependencies_parsed_at":"2022-08-15T13:31:33.186Z","dependency_job_id":null,"html_url":"https://github.com/mattumotu/jenkinsnetclient","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/mattumotu/jenkinsnetclient","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattumotu%2Fjenkinsnetclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattumotu%2Fjenkinsnetclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattumotu%2Fjenkinsnetclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattumotu%2Fjenkinsnetclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mattumotu","download_url":"https://codeload.github.com/mattumotu/jenkinsnetclient/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mattumotu%2Fjenkinsnetclient/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30039884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T06:58:30.252Z","status":"ssl_error","status_checked_at":"2026-03-03T06:58:15.329Z","response_time":61,"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":["csharp","dotnet","jenkins"],"created_at":"2025-01-18T14:38:10.493Z","updated_at":"2026-03-03T09:31:29.831Z","avatar_url":"https://github.com/mattumotu.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JenkinsNet\n\n![JenkinsNET Logo](https://raw.githubusercontent.com/mattumotu/jenkinsnetclient/master/jenkinsnetclient.png \"JenkinsNETClient Logo\") \n\nAllows for easy and simple C# interaction with Jenkins.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/i0a30nv83layh93d/branch/master?svg=true)](https://ci.appveyor.com/project/mattumotu/jenkinsnetclient/branch/master)\n[![Coverage Status](https://coveralls.io/repos/github/mattumotu/jenkinsnetclient/badge.svg?branch=master)](https://coveralls.io/github/mattumotu/jenkinsnetclient?branch=master)\n[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=mattumotu_jenkinsnetclient\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=mattumotu_jenkinsnetclient)\n[![NuGet](https://img.shields.io/nuget/v/jenkinsnetclient.svg)](https://www.nuget.org/packages/JenkinsNetClient/)\n\n## Installation\n\nVia NuGet\n\n    PM\u003e Install-Package JenkinsNetClient\n    \n## Usage\n\n### Basics\n\nFirst you need a connection to a jenkins server, just pass it your jenkins instance's url.\n```cs\nJenkinsConnection myConn = new JenkinsConnection(\"myjenkins\");\n```\n\nIf Jenkins is secuired then you will have to provide a username and api token:\n```cs\nJenkinsConnection myConn = new JenkinsConnection(\"myjenkins\", \"username\", \"apitoken\");\n```\n\nWe can get a list of Views and Jobs from a JenkinsServer\n```cs\nvar myJenkins = new JenkinsServer(myConn);\nList\u003cJenkinsView\u003e views = myJenkins.Views();\nList\u003cJenkinsJob\u003e jobs = myJenkins.Jobs();\n```\n\n### Playing with views\nWe can easily create a new view ...\n```cs\nvar newView = new JenkinsView(myConn, \"hudson.model.ListView\", \"Name of my new view\");\nif(newView.Exists()) \n{\n  throw new exception(\"View already exists on jenkins\");\n}\nnewView.Create(); // Create on jenkins\nif(!newView.Exists()) \n{\n  throw new exception(\"View doesn't exist on jenkins - Create must have failed\");\n}\n```\n\n... or delete an existing view\n```cs\nJenkinsView existingView = views[0];\nexistingView.Delete(); // Delete from jenkins\nif(existingView.Exists()) \n{\n  throw new exception(\"View still exists on jenkins - delete failed\");\n}\n```\n\n### Playing with Jobs\n```cs\nvar newJob = new JenkinsJob(myConn, \"hudson.model.FreeStyleProject\", \"name of new job\");\nif(newJob.Exists()) \n{\n  throw new exception(\"job already exists on jenkins\");\n}\nnewJob.Create(); // Create job on jenkins\nif(!newJob.Exists()) \n{\n  throw new exception(\"job doesn't exist on jenkins after call to create\");\n}\nnewJob.Delete();\nif(newJob.Exists()) \n{\n  throw new exception(\"job still exists on jenkins after call to delete\");\n}           \n```\n\n### Jobs and Views \n\nAdding an existing job to a view ...\n```cs\nJenkinsJob existingJob = Jobs[0];\nJenkinsView existingView = views[0];\nif(!existingView.Contains(existingJob))\n{\n  existingView.Add(existingJob);\n}\nif(!existingView.Contains(existingJob)) \n{\n  throw new exception(\"Add failed\");\n}\n```\n... and removing it again.\n```cs\nexistingView.Remove(existingJob);\nif(existingView.Contains(existingJob)) \n{\n  throw new exception(\"job still on view - remove failed\");\n}\n```\n\n### Getting and Setting config.xml\n\nGetting the config xml for a job\n```cs\nJenkinsJob existingJob = Jobs[0];\nstring configXml = existingJob.Config;\n```\n\nand setting it\n```cs\nJenkinsJob existingJob = Jobs[0];\nexistingJob.Config = xml\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattumotu%2Fjenkinsnetclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattumotu%2Fjenkinsnetclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattumotu%2Fjenkinsnetclient/lists"}